ruby - Unable to autoload constant controller (in production). No error in development -


file name -

app/controllers/invoice/inventory/department/pharmacy_invoices_controller.rb

file content -

class invoice::inventory::department::pharmacyinvoicescontroller < applicationcontroller ... end 

i no error in development in production error -

f, [2016-04-25t13:08:00.754597 #13500] fatal -- : loaderror (unable autoload constant invoice::inventory::department::pharmacyinvoicescontroller, expected /xxxxxx/yyyyyyy/app/controllers/invoice/inventory/department/pharmacy_invoices_controller.rb define it): 

i did ssh , checked every file on server. same development, obvious. can't figure out why throwing such error in production.

this covered in rails docs, in autoloading , reloading constants , nesting.

this because defining nesting can done in 2 ways , different in terms of how seen rails. can check using module.nesting:

module foo   class bar     module.nesting   end end => [foo::bar, foo]  class foo::bar   module.nesting end => [foo::bar] 

if want know more recommend blog post simon coffey: rails autoloading hell


Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -