Jump to content

The ultimate community for Ruby on Rails developers.


Photo

Custom module isn't loaded


  • Please log in to reply
1 reply to this topic

#1 Giacomo

Giacomo

    Signalman

  • Members
  • 13 posts
  • LocationBologna

Posted 03 October 2013 - 02:55 PM

Hi,

In my rails 3.0 application I'm using a file whic are defined some constants, I placed them in custom module in: lib/mymodule/constants.rb

 

To get it working in my local env I added:

module Familia
  class Application < Rails::Application
    [...]
    config.autoload_paths += %W(#{config.root}/lib) 
    config.autoload_paths += %W(#{config.root}/lib/*)

on my config/application file.

 

On my production environment the constants defined are not reachable and I get an error 

uninitialized constant PayChecksController::Familia
Rails.root: /accounts/gpiva/www/export

Application Trace | Framework Trace | Full Trace
app/controllers/pay_checks_controller.rb:109:in `new'

on line 109 I have:

@pay_check.worked_hours = format "%.0f", @contract.week_hours * Familia::Constants::WEEK_TO_MONTH_CONVERSION


--

G.


#2 Giacomo

Giacomo

    Signalman

  • Members
  • 13 posts
  • LocationBologna

Posted 03 October 2013 - 04:07 PM   Best Answer

I solved my problem restarting the server.

The production web server didn't restart after the deploy


--

G.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users