Can't eagerload classes | Rails 4.2.5 - ruby-on-rails

Rails: 4.2.5
I'm using STI and needed to get all Subclasses.
But as in dev environment, rails does Lazy Loading. So Model.subclasses and Model.descendants always return []
Googling sent me to this issue: https://github.com/rails/rails/issues/3364
And the above issue suggested following solution to put as initializer:
ActionDispatch::Reloader.to_prepare do
Rails.application.eager_load!
end
And on that I'm getting following exception:
/Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activemodel-4.2.5/lib/active_model/validations/validates.rb:120:in `rescue in block in validates': Unknown validator: 'PersenceValidator' (ArgumentError)
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activemodel-4.2.5/lib/active_model/validations/validates.rb:117:in `block in validates'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activemodel-4.2.5/lib/active_model/validations/validates.rb:113:in `each'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activemodel-4.2.5/lib/active_model/validations/validates.rb:113:in `validates'
from /Users/vmac1/rails_projects/survd/app/models/sub_service.rb:7:in `<class:SubService>'
from /Users/vmac1/rails_projects/survd/app/models/sub_service.rb:1:in `<top (required)>'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:457:in `load'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:457:in `block in load_file'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:647:in `new_constants_in'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:456:in `load_file'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:354:in `require_or_load'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:494:in `load_missing_constant'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:184:in `const_missing'
from /Users/vmac1/rails_projects/survd/app/models/buffet_service.rb:1:in `<top (required)>'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:457:in `load'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:457:in `block in load_file'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:647:in `new_constants_in'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:456:in `load_file'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:354:in `require_or_load'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:317:in `depend_on'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:233:in `require_dependency'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/railties-4.2.5/lib/rails/engine.rb:472:in `block (2 levels) in eager_load!'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/railties-4.2.5/lib/rails/engine.rb:471:in `each'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/railties-4.2.5/lib/rails/engine.rb:471:in `block in eager_load!'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/railties-4.2.5/lib/rails/engine.rb:469:in `each'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/railties-4.2.5/lib/rails/engine.rb:469:in `eager_load!'
from /Users/vmac1/rails_projects/survd/config/initializers/eagerload_subclasses.rb:2:in `block in <top (required)>'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:446:in `instance_exec'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:446:in `block in make_lambda'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:192:in `call'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:192:in `block in simple'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:504:in `call'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:504:in `block in call'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:504:in `each'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:504:in `call'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:92:in `__run_callbacks__'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:778:in `_run_prepare_callbacks'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:81:in `run_callbacks'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/actionpack-4.2.5/lib/action_dispatch/middleware/reloader.rb:83:in `prepare!'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/actionpack-4.2.5/lib/action_dispatch/middleware/reloader.rb:55:in `prepare!'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/railties-4.2.5/lib/rails/application/finisher.rb:50:in `block in <module:Finisher>'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/railties-4.2.5/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/railties-4.2.5/lib/rails/initializable.rb:30:in `run'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/railties-4.2.5/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/vmac1/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
from /Users/vmac1/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
from /Users/vmac1/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
from /Users/vmac1/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
from /Users/vmac1/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:345:in `each'
from /Users/vmac1/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:345:in `call'
from /Users/vmac1/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
from /Users/vmac1/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
from /Users/vmac1/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/railties-4.2.5/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/railties-4.2.5/lib/rails/application.rb:352:in `initialize!'
from /Users/vmac1/rails_projects/survd/config/environment.rb:5:in `<top (required)>'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `block in require'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:240:in `load_dependency'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/spring-1.6.3/lib/spring/application.rb:92:in `preload'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/spring-1.6.3/lib/spring/application.rb:143:in `serve'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/spring-1.6.3/lib/spring/application.rb:131:in `block in run'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/spring-1.6.3/lib/spring/application.rb:125:in `loop'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/spring-1.6.3/lib/spring/application.rb:125:in `run'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/spring-1.6.3/lib/spring/application/boot.rb:18:in `<top (required)>'
from /Users/vmac1/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/vmac1/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from -e:1:in `<main>'

As others have said, the actual error is a validation typo. But in regards to the original problem, Rails 4.2 eager-loads all classes in production by default, so you'd just have to change the eager_load and cache_classes setting in your other environments to get the same behavior. However, this will make development much more unpleasant since you'll have to restart the server every time you make a code change.
What is the underlying problem you're trying to solve by listing all subclasses? There might be another design that would avoid that requirement.

Typo of persence instead of presence

Related

Rails/Ubuntu uninitialized namespaced constants on load

When starting my rails application on Ubuntu (through any process e.g. console, server, rake tasks, etc) I get an uninitialised constant error from my gems. However, I can clone the exact same repo on to OSX and it works. The error I show is coming from apartment, but if I remove the references to Core::Organisation, the issue just propagates to the next loaded gem. So I figure it's something to do with the gems being loaded before the constants from the application.
I've tried eager loading using
config.eager_load = true
config.enable_dependency_loading = true
but it didn't change anything.
UPDATE:
I've found replacing "Core::Organisation" with just "Organisation" makes it work. So it's something to do with the namespacing. In the base directory there is a module core.rb:
module Core
def self.table_name_prefix
'core_'
end
end
Environment:
Ubuntu 18.04
Ruby 2.5.0
Rails 5.2.2
Example error trace:
/var/lib/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:74:in `block in load_missing_constant': uninitialized constant Core::Organisation (NameError)
from /var/lib/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:8:in `without_bootsnap_cache'
from /var/lib/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:74:in `rescue in load_missing_constant'
from /var/lib/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:56:in `load_missing_constant'
from /var/lib/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/inflector/methods.rb:285:in `const_get'
from /var/lib/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/inflector/methods.rb:285:in `block in constantize'
from /var/lib/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/inflector/methods.rb:281:in `each'
from /var/lib/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/inflector/methods.rb:281:in `inject'
from /var/lib/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/inflector/methods.rb:281:in `constantize'
from /var/lib/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/string/inflections.rb:68:in `constantize'
from /var/lib/gems/2.5.0/gems/apartment-2.2.0/lib/apartment/adapters/postgresql_adapter.rb:50:in `process_excluded_model'
from /var/lib/gems/2.5.0/gems/apartment-2.2.0/lib/apartment/adapters/abstract_adapter.rb:105:in `block in process_excluded_models'
from /var/lib/gems/2.5.0/gems/apartment-2.2.0/lib/apartment/adapters/abstract_adapter.rb:104:in `each'
from /var/lib/gems/2.5.0/gems/apartment-2.2.0/lib/apartment/adapters/abstract_adapter.rb:104:in `process_excluded_models'
from /var/lib/gems/2.5.0/gems/apartment-2.2.0/lib/apartment/tenant.rb:18:in `init'
from /var/lib/gems/2.5.0/gems/apartment-2.2.0/lib/apartment/railtie.rb:34:in `block (2 levels) in <class:Railtie>'
from /var/lib/gems/2.5.0/gems/activerecord-5.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:416:in `with_connection'
from /var/lib/gems/2.5.0/gems/apartment-2.2.0/lib/apartment/railtie.rb:33:in `block in <class:Railtie>'
from /var/lib/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/callbacks.rb:426:in `instance_exec'
from /var/lib/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/callbacks.rb:426:in `block in make_lambda'
from /var/lib/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/callbacks.rb:198:in `block (2 levels) in halting'
from /var/lib/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/callbacks.rb:606:in `block (2 levels) in default_terminator'
from /var/lib/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/callbacks.rb:605:in `catch'
from /var/lib/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/callbacks.rb:605:in `block in default_terminator'
from /var/lib/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/callbacks.rb:199:in `block in halting'
from /var/lib/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/callbacks.rb:513:in `block in invoke_before'
from /var/lib/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/callbacks.rb:513:in `each'
from /var/lib/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/callbacks.rb:513:in `invoke_before'
from /var/lib/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/callbacks.rb:131:in `run_callbacks'
from /var/lib/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/reloader.rb:89:in `prepare!'
from /var/lib/gems/2.5.0/gems/railties-5.2.2/lib/rails/application/finisher.rb:63:in `block in <module:Finisher>'
from /var/lib/gems/2.5.0/gems/railties-5.2.2/lib/rails/initializable.rb:32:in `instance_exec'
from /var/lib/gems/2.5.0/gems/railties-5.2.2/lib/rails/initializable.rb:32:in `run'
from /var/lib/gems/2.5.0/gems/railties-5.2.2/lib/rails/initializable.rb:61:in `block in run_initializers'
from /usr/lib/ruby/2.5.0/tsort.rb:228:in `block in tsort_each'
from /usr/lib/ruby/2.5.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
from /usr/lib/ruby/2.5.0/tsort.rb:431:in `each_strongly_connected_component_from'
from /usr/lib/ruby/2.5.0/tsort.rb:349:in `block in each_strongly_connected_component'
from /usr/lib/ruby/2.5.0/tsort.rb:347:in `each'
from /usr/lib/ruby/2.5.0/tsort.rb:347:in `call'
from /usr/lib/ruby/2.5.0/tsort.rb:347:in `each_strongly_connected_component'
from /usr/lib/ruby/2.5.0/tsort.rb:226:in `tsort_each'
from /usr/lib/ruby/2.5.0/tsort.rb:205:in `tsort_each'
from /var/lib/gems/2.5.0/gems/railties-5.2.2/lib/rails/initializable.rb:60:in `run_initializers'
from /var/lib/gems/2.5.0/gems/railties-5.2.2/lib/rails/application.rb:361:in `initialize!'
from /home/sellsmartadmin/Sellsmart/config/environment.rb:5:in `<main>'
from /var/lib/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
from /var/lib/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
from /var/lib/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
from /var/lib/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
from /var/lib/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
from /var/lib/gems/2.5.0/gems/spring-2.0.2/lib/spring/application.rb:102:in `preload'
from /var/lib/gems/2.5.0/gems/spring-2.0.2/lib/spring/application.rb:153:in `serve'
from /var/lib/gems/2.5.0/gems/spring-2.0.2/lib/spring/application.rb:141:in `block in run'
from /var/lib/gems/2.5.0/gems/spring-2.0.2/lib/spring/application.rb:135:in `loop'
from /var/lib/gems/2.5.0/gems/spring-2.0.2/lib/spring/application.rb:135:in `run'
from /var/lib/gems/2.5.0/gems/spring-2.0.2/lib/spring/application/boot.rb:19:in `<top (required)>'
from /usr/local/lib/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /usr/local/lib/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from -e:1:in `<main>'
Thanks in advance for any help anyone has to offer!
I've found the answer!
Turns out Linux is just a bit more fussy about directories than OSX. My namespaced modules were in a directory called "Core/". When I changed this to "core" (all lowercase), everything worked as expected.

mandrill-mailer with sidekiq 5.0.4 uninitialized constant Sidekiq::Extensions::ActionMailer

I've juste updated the sidekiq gem to 5.0.4, and now I have this error when I run my server.
NameError: uninitialized constant Sidekiq::Extensions::ActionMailer
/Users/mike/Documents/paycar/back_end/config/initializers/mail.rb:15:in `<top (required)>'
/Users/mike/.rvm/gems/ruby-2.3.1#paycar-api/gems/railties-4.2.7.1/lib/rails/engine.rb:652:in `block in load_config_initializer'
/Users/mike/.rvm/gems/ruby-2.3.1#paycar-api/gems/activesupport-4.2.7.1/lib/active_support/notifications.rb:166:in `instrument'
/Users/mike/.rvm/gems/ruby-2.3.1#paycar-api/gems/railties-4.2.7.1/lib/rails/engine.rb:651:in `load_config_initializer'
/Users/mike/.rvm/gems/ruby-2.3.1#paycar-api/gems/railties-4.2.7.1/lib/rails/engine.rb:616:in `block (2 levels) in <class:Engine>'
/Users/mike/.rvm/gems/ruby-2.3.1#paycar-api/gems/railties-4.2.7.1/lib/rails/engine.rb:615:in `each'
/Users/mike/.rvm/gems/ruby-2.3.1#paycar-api/gems/railties-4.2.7.1/lib/rails/engine.rb:615:in `block in <class:Engine>'
/Users/mike/.rvm/gems/ruby-2.3.1#paycar-api/gems/railties-4.2.7.1/lib/rails/initializable.rb:30:in `instance_exec'
/Users/mike/.rvm/gems/ruby-2.3.1#paycar-api/gems/railties-4.2.7.1/lib/rails/initializable.rb:30:in `run'
/Users/mike/.rvm/gems/ruby-2.3.1#paycar-api/gems/railties-4.2.7.1/lib/rails/initializable.rb:55:in `block in run_initializers'
/Users/mike/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each'
/Users/mike/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
/Users/mike/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
/Users/mike/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from'
/Users/mike/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:421:in `block in each_strongly_connected_component_from'
/Users/mike/.rvm/gems/ruby-2.3.1#paycar-api/gems/railties-4.2.7.1/lib/rails/initializable.rb:44:in `each'
/Users/mike/.rvm/gems/ruby-2.3.1#paycar-api/gems/railties-4.2.7.1/lib/rails/initializable.rb:44:in `tsort_each_child'
/Users/mike/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:415:in `call'
/Users/mike/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:415:in `each_strongly_connected_component_from'
/Users/mike/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component'
/Users/mike/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:347:in `each'
/Users/mike/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:347:in `call'
/Users/mike/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component'
/Users/mike/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:226:in `tsort_each'
/Users/mike/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:205:in `tsort_each'
/Users/mike/.rvm/gems/ruby-2.3.1#paycar-api/gems/railties-4.2.7.1/lib/rails/initializable.rb:54:in `run_initializers'
/Users/mike/.rvm/gems/ruby-2.3.1#paycar-api/gems/railties-4.2.7.1/lib/rails/application.rb:352:in `initialize!'
/Users/mike/Documents/paycar/back_end/config/environment.rb:6:in `<top (required)>'
/Users/mike/Documents/paycar/back_end/spec/rails_helper.rb:5:in `require'
/Users/mike/Documents/paycar/back_end/spec/rails_helper.rb:5:in `<top (required)>'
/Users/mike/Documents/paycar/back_end/spec/controllers/api/csrf_controller_spec.rb:2:in `require'
/Users/mike/Documents/paycar/back_end/spec/controllers/api/csrf_controller_spec.rb:2:in `<top (required)>'
/Users/mike/.rvm/gems/ruby-2.3.1#paycar-api/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1226:in `load'
/Users/mike/.rvm/gems/ruby-2.3.1#paycar-api/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1226:in `block in load_spec_files'
/Users/mike/.rvm/gems/ruby-2.3.1#paycar-api/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1224:in `each'
/Users/mike/.rvm/gems/ruby-2.3.1#paycar-api/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1224:in `load_spec_files'
/Users/mike/.rvm/gems/ruby-2.3.1#paycar-api/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:97:in `setup'
/Users/mike/.rvm/gems/ruby-2.3.1#paycar-api/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:85:in `run'
/Users/mike/.rvm/gems/ruby-2.3.1#paycar-api/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:70:in `run'
/Users/mike/.rvm/gems/ruby-2.3.1#paycar-api/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:38:in `invoke'
/Users/mike/.rvm/gems/ruby-2.3.1#paycar-api/gems/rspec-core-3.2.3/exe/rspec:4:in `<top (required)>'
/Users/mike/.rvm/gems/ruby-2.3.1#paycar-api/bin/rspec:22:in `load'
/Users/mike/.rvm/gems/ruby-2.3.1#paycar-api/bin/rspec:22:in `<top (required)>'
now line 15 in mail.rb is this
::MandrillMailer::TemplateMailer.extend(Sidekiq::Extensions::ActionMailer)
I've tried adding config.eager_loading = true and also tried to add the classes config.autoload_paths but that didn't help.
Any help would be greatly appreciated.
It might be a file ordering thing. You can see that Sidekiq::Extensions::ActionMailer is defined at https://github.com/mperham/sidekiq/blob/master/lib/sidekiq/extensions/action_mailer.rb. Perhaps try adding a require 'sidekiq/extensions/action_mailer' line at the top?
See "The Delayed Extensions..."
https://github.com/mperham/sidekiq/blob/master/5.0-Upgrade.md#whats-new

Devise error in basic setup stage

I have used Devise a million times, but I have never had this issue. I have placed the gem in my gem file. I did 'bundle install' then I typed ' rails generate devise:install' and I get this error:
/Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.0.2/lib/active_support/inflector/methods.rb:268:in `const_get': uninitialized constant User (NameError)
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.0.2/lib/active_support/inflector/methods.rb:268:in `block in constantize'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.0.2/lib/active_support/inflector/methods.rb:266:in `each'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.0.2/lib/active_support/inflector/methods.rb:266:in `inject'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.0.2/lib/active_support/inflector/methods.rb:266:in `constantize'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/devise-4.2.1/lib/devise.rb:305:in `get'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/devise-4.2.1/lib/devise/mapping.rb:81:in `to'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/devise-4.2.1/lib/devise/mapping.rb:76:in `modules'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/devise-4.2.1/lib/devise/mapping.rb:93:in `routes'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/devise-4.2.1/lib/devise/mapping.rb:160:in `default_used_route'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/devise-4.2.1/lib/devise/mapping.rb:70:in `initialize'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/devise-4.2.1/lib/devise.rb:335:in `new'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/devise-4.2.1/lib/devise.rb:335:in `add_mapping'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/devise-4.2.1/lib/devise/rails/routes.rb:241:in `block in devise_for'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/devise-4.2.1/lib/devise/rails/routes.rb:240:in `each'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/devise-4.2.1/lib/devise/rails/routes.rb:240:in `devise_for'
from /Users/johnseabolt/Desktop/2. Projects/ReactBlog/config/routes.rb:2:in `block in <top (required)>'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/actionpack-5.0.2/lib/action_dispatch/routing/route_set.rb:389:in `instance_exec'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/actionpack-5.0.2/lib/action_dispatch/routing/route_set.rb:389:in `eval_block'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/actionpack-5.0.2/lib/action_dispatch/routing/route_set.rb:371:in `draw'
from /Users/johnseabolt/Desktop/2. Projects/ReactBlog/config/routes.rb:1:in `<top (required)>'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/application/routes_reloader.rb:40:in `each'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/application/routes_reloader.rb:40:in `load_paths'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/application/routes_reloader.rb:16:in `reload!'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/application/routes_reloader.rb:26:in `block in updater'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.0.2/lib/active_support/file_update_checker.rb:77:in `execute'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/application/routes_reloader.rb:27:in `updater'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/application/finisher.rb:119:in `block in <module:Finisher>'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/initializable.rb:30:in `run'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:347:in `each'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:347:in `call'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:226:in `tsort_each'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:205:in `tsort_each'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/application.rb:352:in `initialize!'
from /Users/johnseabolt/Desktop/2. Projects/ReactBlog/config/environment.rb:5:in `<top (required)>'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-2.0.1/lib/spring/application.rb:92:in `preload'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-2.0.1/lib/spring/application.rb:143:in `serve'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-2.0.1/lib/spring/application.rb:131:in `block in run'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-2.0.1/lib/spring/application.rb:125:in `loop'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-2.0.1/lib/spring/application.rb:125:in `run'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-2.0.1/lib/spring/application/boot.rb:19:in `<top (required)>'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'
I previously had gotten past this step, but I was turning around and trying it again. I had already run 'rails generate devise User,' but had received an error. If I run that same command again, I get this:
/Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.0.2/lib/active_support/inflector/methods.rb:268:in `const_get': uninitialized constant User (NameError)
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.0.2/lib/active_support/inflector/methods.rb:268:in `block in constantize'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.0.2/lib/active_support/inflector/methods.rb:266:in `each'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.0.2/lib/active_support/inflector/methods.rb:266:in `inject'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.0.2/lib/active_support/inflector/methods.rb:266:in `constantize'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/devise-4.2.1/lib/devise.rb:305:in `get'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/devise-4.2.1/lib/devise/mapping.rb:81:in `to'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/devise-4.2.1/lib/devise/mapping.rb:76:in `modules'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/devise-4.2.1/lib/devise/mapping.rb:93:in `routes'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/devise-4.2.1/lib/devise/mapping.rb:160:in `default_used_route'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/devise-4.2.1/lib/devise/mapping.rb:70:in `initialize'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/devise-4.2.1/lib/devise.rb:335:in `new'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/devise-4.2.1/lib/devise.rb:335:in `add_mapping'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/devise-4.2.1/lib/devise/rails/routes.rb:241:in `block in devise_for'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/devise-4.2.1/lib/devise/rails/routes.rb:240:in `each'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/devise-4.2.1/lib/devise/rails/routes.rb:240:in `devise_for'
from /Users/johnseabolt/Desktop/2. Projects/ReactBlog/config/routes.rb:2:in `block in <top (required)>'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/actionpack-5.0.2/lib/action_dispatch/routing/route_set.rb:389:in `instance_exec'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/actionpack-5.0.2/lib/action_dispatch/routing/route_set.rb:389:in `eval_block'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/actionpack-5.0.2/lib/action_dispatch/routing/route_set.rb:371:in `draw'
from /Users/johnseabolt/Desktop/2. Projects/ReactBlog/config/routes.rb:1:in `<top (required)>'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/application/routes_reloader.rb:40:in `each'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/application/routes_reloader.rb:40:in `load_paths'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/application/routes_reloader.rb:16:in `reload!'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/application/routes_reloader.rb:26:in `block in updater'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.0.2/lib/active_support/file_update_checker.rb:77:in `execute'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/application/routes_reloader.rb:27:in `updater'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/application/finisher.rb:119:in `block in <module:Finisher>'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/initializable.rb:30:in `run'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:347:in `each'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:347:in `call'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:226:in `tsort_each'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:205:in `tsort_each'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/application.rb:352:in `initialize!'
from /Users/johnseabolt/Desktop/2. Projects/ReactBlog/config/environment.rb:5:in `<top (required)>'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-2.0.1/lib/spring/application.rb:92:in `preload'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-2.0.1/lib/spring/application.rb:143:in `serve'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-2.0.1/lib/spring/application.rb:131:in `block in run'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-2.0.1/lib/spring/application.rb:125:in `loop'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-2.0.1/lib/spring/application.rb:125:in `run'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-2.0.1/lib/spring/application/boot.rb:19:in `<top (required)>'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'
Can someone help? I can't seem to get past this basic setup stage.
Your error shows you added devise_for :user in routes.rb when you haven't set it up yet, as shown here:
from /Users/johnseabolt/Desktop/2. Projects/ReactBlog/config/routes.rb:2:in `<top (required)>'
Remove devise_for :user from routes.rb, run the install generator, then add devise_for :user again if it worked out.

Elastic Beanstalk Rails deploy mystery initialize error

I am trying to deploy an existing heroku app to EC2 using Beanstalk.
So far I have all the Environment variables moved over and the database setup.. etc. It seems to work and deploy correct except for Puma.
The puma.log file has the following in it over and over;
/opt/rubies/ruby-2.2.2/lib/ruby/2.2.0/pathname.rb:397:in `initialize': no implicit conversion of nil into String (TypeError)
from /opt/rubies/ruby-2.2.2/lib/ruby/2.2.0/pathname.rb:397:in `new'
from /opt/rubies/ruby-2.2.2/lib/ruby/2.2.0/pathname.rb:397:in `join'
from /var/app/current/config/initializers/cloudfront-signer.rb:2:in `block in <top (required)>'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/cloudfront-signer-2.2.0/lib/cloudfront-signer.rb:108:in `configure'
from /var/app/current/config/initializers/cloudfront-signer.rb:1:in `<top (required)>'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `load'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `block in load'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in `load_dependency'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `load'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/engine.rb:652:in `block in load_config_initializer'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active_support/notifications.rb:166:in `instrument'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/engine.rb:651:in `load_config_initializer'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/engine.rb:616:in `block (2 levels) in <class:Engine>'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/engine.rb:615:in `each'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/engine.rb:615:in `block in <class:Engine>'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/initializable.rb:30:in `instance_exec'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/initializable.rb:30:in `run'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/initializable.rb:55:in `block in run_initializers'
from /opt/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
from /opt/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
from /opt/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:420:in `block (2 levels) in each_strongly_connected_component_from'
from /opt/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
from /opt/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:419:in `block in each_strongly_connected_component_from'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/initializable.rb:44:in `each'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/initializable.rb:44:in `tsort_each_child'
from /opt/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:413:in `call'
from /opt/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:413:in `each_strongly_connected_component_from'
from /opt/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
from /opt/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `each'
from /opt/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `call'
from /opt/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
from /opt/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
from /opt/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/initializable.rb:54:in `run_initializers'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/application.rb:352:in `initialize!'
from /var/app/current/config/environment.rb:5:in `<top (required)>'
from config.ru:3:in `require'
from config.ru:3:in `block in <main>'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `instance_eval'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `initialize'
from config.ru:in `new'
from config.ru:in `<main>'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in `eval'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in `new_from_string'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:40:in `parse_file'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/puma-2.11.2/lib/puma/configuration.rb:102:in `load_rackup'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/puma-2.11.2/lib/puma/configuration.rb:69:in `app'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/puma-2.11.2/lib/puma/runner.rb:123:in `app'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/puma-2.11.2/lib/puma/runner.rb:130:in `start_server'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/puma-2.11.2/lib/puma/cluster.rb:213:in `worker'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/puma-2.11.2/lib/puma/cluster.rb:109:in `block (2 levels) in spawn_workers'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/puma-2.11.2/lib/puma/cluster.rb:109:in `fork'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/puma-2.11.2/lib/puma/cluster.rb:109:in `block in spawn_workers'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/puma-2.11.2/lib/puma/cluster.rb:105:in `times'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/puma-2.11.2/lib/puma/cluster.rb:105:in `spawn_workers'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/puma-2.11.2/lib/puma/cluster.rb:157:in `check_workers'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/puma-2.11.2/lib/puma/cluster.rb:421:in `run'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/puma-2.11.2/lib/puma/cli.rb:216:in `run'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/puma-2.11.2/bin/puma:10:in `<top (required)>'
from /opt/rubies/ruby-2.2.2/bin/puma:23:in `load'
from /opt/rubies/ruby-2.2.2/bin/puma:23:in `<main>'
I have no clue what this is or why its happening and am at a complete loss..
Line 5 of config/environment is Rails.application.initialize!
Line 3 of config.ru is run Rails.application
So does this mean that Rails.application hasn't been defined? I'm a tad confused.
Again this app works perfectly on Heroku.
Suggestions?

Unable to install devise gem "unidentified method for install"on Rails

When I try to perform "rails generate devise:install" I get this error message:
I've tried re-installing the devise gem multiple times. This error also comes up when I try to start up my server. I'm wondering if the cause of this is from initially trying to install the devise gem with "rails generate devise install" instead of putting a colon between devise and install.
Maxs-MacBook-Air:pinteresting allecat941$ rails generate devise:install
/Users/allecat941/.rvm/gems/ruby-2.1.1/gems/activerecord-4.1.1/lib/active_record/dynamic_matchers.rb:26:in `method_missing': undefined method `devise' for Install (call 'Install.connection' to establish a connection):Class (NoMethodError)
from /Users/allecat941/pinteresting/app/models/install.rb:4:in `<class:Install>'
from /Users/allecat941/pinteresting/app/models/install.rb:1:in `<top (required)>'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:443:in `load'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:443:in `block in load_file'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:633:in `new_constants_in'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:442:in `load_file'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:342:in `require_or_load'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:480:in `load_missing_constant'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:180:in `const_missing'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/inflector/methods.rb:238:in `const_get'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/inflector/methods.rb:238:in `block in constantize'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/inflector/methods.rb:236:in `each'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/inflector/methods.rb:236:in `inject'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/inflector/methods.rb:236:in `constantize'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:552:in `get'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:583:in `constantize'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/devise-3.2.4/lib/devise.rb:297:in `get'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/devise-3.2.4/lib/devise/mapping.rb:77:in `to'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/devise-3.2.4/lib/devise/mapping.rb:72:in `modules'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/devise-3.2.4/lib/devise/mapping.rb:89:in `routes'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/devise-3.2.4/lib/devise/mapping.rb:156:in `default_used_route'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/devise-3.2.4/lib/devise/mapping.rb:66:in `initialize'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/devise-3.2.4/lib/devise.rb:331:in `new'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/devise-3.2.4/lib/devise.rb:331:in `add_mapping'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/devise-3.2.4/lib/devise/rails/routes.rb:221:in `block in devise_for'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/devise-3.2.4/lib/devise/rails/routes.rb:220:in `each'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/devise-3.2.4/lib/devise/rails/routes.rb:220:in `devise_for'
from /Users/allecat941/pinteresting/config/routes.rb:2:in `block in <top (required)>'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/actionpack-4.1.1/lib/action_dispatch/routing/route_set.rb:335:in `instance_exec'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/actionpack-4.1.1/lib/action_dispatch/routing/route_set.rb:335:in `eval_block'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/actionpack-4.1.1/lib/action_dispatch/routing/route_set.rb:313:in `draw'
from /Users/allecat941/pinteresting/config/routes.rb:1:in `<top (required)>'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:241:in `load'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:241:in `block in load'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:232:in `load_dependency'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:241:in `load'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/application/routes_reloader.rb:40:in `each'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/application/routes_reloader.rb:40:in `load_paths'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/application/routes_reloader.rb:16:in `reload!'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/application/routes_reloader.rb:26:in `block in updater'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/file_update_checker.rb:75:in `call'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/file_update_checker.rb:75:in `execute'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/application/routes_reloader.rb:27:in `updater'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/application/finisher.rb:71:in `block in <module:Finisher>'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/initializable.rb:30:in `run'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/allecat941/.rbenv/versions/2.0.0-p451/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
from /Users/allecat941/.rbenv/versions/2.0.0-p451/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
from /Users/allecat941/.rbenv/versions/2.0.0-p451/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from'
from /Users/allecat941/.rbenv/versions/2.0.0-p451/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component'
from /Users/allecat941/.rbenv/versions/2.0.0-p451/lib/ruby/2.0.0/tsort.rb:180:in `each'
from /Users/allecat941/.rbenv/versions/2.0.0-p451/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component'
from /Users/allecat941/.rbenv/versions/2.0.0-p451/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/application.rb:288:in `initialize!'
from /Users/allecat941/pinteresting/config/environment.rb:5:in `<top (required)>'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `require'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `block in require'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:232:in `load_dependency'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `require'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/spring-1.1.3/lib/spring/application.rb:92:in `preload'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/spring-1.1.3/lib/spring/application.rb:140:in `serve'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/spring-1.1.3/lib/spring/application.rb:128:in `block in run'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/spring-1.1.3/lib/spring/application.rb:122:in `loop'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/spring-1.1.3/lib/spring/application.rb:122:in `run'
from /Users/allecat941/.rvm/gems/ruby-2.1.1/gems/spring-1.1.3/lib/spring/application/boot.rb:18:in `<top (required)>'
from /Users/allecat941/.rbenv/versions/2.0.0-p451/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/allecat941/.rbenv/versions/2.0.0-p451/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'
It looks like your accidental install created Install model and other files. Delete those, perhaps?
I am using the device gem and without devise install . Then use, the cmd rails g device auth in this case rails throw the error than using this method my problem is solved
extend Devise::Models
in my auth.rb files
class Auth < ApplicationRecord
extend Devise::Models
end

Resources