Rails undefined method "to_time_preserves_timezone" - ruby-on-rails

Something was broken and now no one generator is not works but i'm nothing change after i'm using rails generator last time. That's i got in a console
/home/sanua/ct/config/initializers/new_framework_defaults.rb:15:in `<top (required)>': undefined method `to_time_preserves_timezone=' for ActiveSupport:Module (NoMethodError)
from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:268:in `load'
from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:268:in `block in load'
from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:240:in `load_dependency'
from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:268:in `load'
from /usr/lib/ruby/vendor_ruby/rails/engine.rb:652:in `block in load_config_initializer'
from /usr/lib/ruby/vendor_ruby/active_support/notifications.rb:166:in `instrument'
from /usr/lib/ruby/vendor_ruby/rails/engine.rb:651:in `load_config_initializer'
from /usr/lib/ruby/vendor_ruby/rails/engine.rb:616:in `block (2 levels) in <class:Engine>'
from /usr/lib/ruby/vendor_ruby/rails/engine.rb:615:in `each'
from /usr/lib/ruby/vendor_ruby/rails/engine.rb:615:in `block in <class:Engine>'
from /usr/lib/ruby/vendor_ruby/rails/initializable.rb:30:in `instance_exec'
from /usr/lib/ruby/vendor_ruby/rails/initializable.rb:30:in `run'
from /usr/lib/ruby/vendor_ruby/rails/initializable.rb:55:in `block in run_initializers'
from /usr/lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each'
from /usr/lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
from /usr/lib/ruby/2.3.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
from /usr/lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from'
from /usr/lib/ruby/2.3.0/tsort.rb:421:in `block in each_strongly_connected_component_from'
from /usr/lib/ruby/vendor_ruby/rails/initializable.rb:44:in `each'
from /usr/lib/ruby/vendor_ruby/rails/initializable.rb:44:in `tsort_each_child'
from /usr/lib/ruby/2.3.0/tsort.rb:415:in `call'
from /usr/lib/ruby/2.3.0/tsort.rb:415:in `each_strongly_connected_component_from'
from /usr/lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component'
from /usr/lib/ruby/2.3.0/tsort.rb:347:in `each'
from /usr/lib/ruby/2.3.0/tsort.rb:347:in `call'
from /usr/lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component'
from /usr/lib/ruby/2.3.0/tsort.rb:226:in `tsort_each'
from /usr/lib/ruby/2.3.0/tsort.rb:205:in `tsort_each'
from /usr/lib/ruby/vendor_ruby/rails/initializable.rb:54:in `run_initializers'
from /usr/lib/ruby/vendor_ruby/rails/application.rb:352:in `initialize!'
from /home/sanua/ct/config/environment.rb:5:in `<top (required)>'
from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:274:in `require'
from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:274:in `block in require'
from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:240:in `load_dependency'
from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:274:in `require'
from /usr/lib/ruby/vendor_ruby/spring/application.rb:92:in `preload'
from /usr/lib/ruby/vendor_ruby/spring/application.rb:143:in `serve'
from /usr/lib/ruby/vendor_ruby/spring/application.rb:131:in `block in run'
from /usr/lib/ruby/vendor_ruby/spring/application.rb:125:in `loop'
from /usr/lib/ruby/vendor_ruby/spring/application.rb:125:in `run'
from /usr/lib/ruby/vendor_ruby/spring/application/boot.rb:18:in `<top (required)>'
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'/home/sanua/ct/config/initializers/new_framework_defaults.rb:15:in `<top (required)>': undefined method `to_time_preserves_timezone=' for ActiveSupport:Module (NoMethodError)
from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:268:in `load'
from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:268:in `block in load'
from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:240:in `load_dependency'
from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:268:in `load'
from /usr/lib/ruby/vendor_ruby/rails/engine.rb:652:in `block in load_config_initializer'
from /usr/lib/ruby/vendor_ruby/active_support/notifications.rb:166:in `instrument'
from /usr/lib/ruby/vendor_ruby/rails/engine.rb:651:in `load_config_initializer'
from /usr/lib/ruby/vendor_ruby/rails/engine.rb:616:in `block (2 levels) in <class:Engine>'
from /usr/lib/ruby/vendor_ruby/rails/engine.rb:615:in `each'
from /usr/lib/ruby/vendor_ruby/rails/engine.rb:615:in `block in <class:Engine>'
from /usr/lib/ruby/vendor_ruby/rails/initializable.rb:30:in `instance_exec'
from /usr/lib/ruby/vendor_ruby/rails/initializable.rb:30:in `run'
from /usr/lib/ruby/vendor_ruby/rails/initializable.rb:55:in `block in run_initializers'
from /usr/lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each'
from /usr/lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
from /usr/lib/ruby/2.3.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
from /usr/lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from'
from /usr/lib/ruby/2.3.0/tsort.rb:421:in `block in each_strongly_connected_component_from'
from /usr/lib/ruby/vendor_ruby/rails/initializable.rb:44:in `each'
from /usr/lib/ruby/vendor_ruby/rails/initializable.rb:44:in `tsort_each_child'
from /usr/lib/ruby/2.3.0/tsort.rb:415:in `call'
from /usr/lib/ruby/2.3.0/tsort.rb:415:in `each_strongly_connected_component_from'
from /usr/lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component'
from /usr/lib/ruby/2.3.0/tsort.rb:347:in `each'
from /usr/lib/ruby/2.3.0/tsort.rb:347:in `call'
from /usr/lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component'
from /usr/lib/ruby/2.3.0/tsort.rb:226:in `tsort_each'
from /usr/lib/ruby/2.3.0/tsort.rb:205:in `tsort_each'
from /usr/lib/ruby/vendor_ruby/rails/initializable.rb:54:in `run_initializers'
from /usr/lib/ruby/vendor_ruby/rails/application.rb:352:in `initialize!'
from /home/sanua/ct/config/environment.rb:5:in `<top (required)>'
from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:274:in `require'
from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:274:in `block in require'
from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:240:in `load_dependency'
from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:274:in `require'
from /usr/lib/ruby/vendor_ruby/spring/application.rb:92:in `preload'
from /usr/lib/ruby/vendor_ruby/spring/application.rb:143:in `serve'
from /usr/lib/ruby/vendor_ruby/spring/application.rb:131:in `block in run'
from /usr/lib/ruby/vendor_ruby/spring/application.rb:125:in `loop'
from /usr/lib/ruby/vendor_ruby/spring/application.rb:125:in `run'
from /usr/lib/ruby/vendor_ruby/spring/application/boot.rb:18:in `<top (required)>'
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'
I constantly see this message whatever i write(rails generate controller, model...)

you need to delete the Gemfile.lock and bundle install after that, as the correct version will then be fetched.

#TRIGUN117 I would suggest you to create a new rails app since its a problem with initializer. I believe something is corrupted in your app.

Perhaps you just have an incompatible version of active_support. If you do not belong on gem versions, simply delete Gemfile.lock and execute bundle to update gems and regenerate the Gemfile.lock. If you do, or problem still exists, look through Gemfile and make sure that all rails' gems have the same version specified.

Related

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.

Monkey patching ENV in a Rails app end with ENV is not a class (TypeError)

I'm trying to add some functionality to the ENV class of a Rails 4 App.
My initializer at config/initializers/env_extend.rb looks like this:
class ENV
def self.enabled?(env_key)
if ENV[env_key].nil?
return false
else
return ActiveRecord::ConnectionAdapters::Column::TRUE_VALUES.include?(ENV[env_key])
end
end
end
Yet when I load the app with rails console it won't load, and the following is printed out
[mveksler:...web/lib/core_extensions/ENV]$ cd ~/Developer/referral-web
/Users/mveksler/Developer/referral-web/config/initializers/env_extend.rb:1:in `<top (required)>': ENV is not a class (TypeError)
from /Users/mveksler/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:268:in `load'
from /Users/mveksler/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:268:in `block in load'
from /Users/mveksler/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:240:in `load_dependency'
from /Users/mveksler/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:268:in `load'
from /Users/mveksler/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/engine.rb:652:in `block in load_config_initializer'
from /Users/mveksler/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-4.2.6/lib/active_support/notifications.rb:166:in `instrument'
from /Users/mveksler/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/engine.rb:651:in `load_config_initializer'
from /Users/mveksler/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/engine.rb:616:in `block (2 levels) in <class:Engine>'
from /Users/mveksler/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/engine.rb:615:in `each'
from /Users/mveksler/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/engine.rb:615:in `block in <class:Engine>'
from /Users/mveksler/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/mveksler/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/initializable.rb:30:in `run'
from /Users/mveksler/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/mveksler/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each'
from /Users/mveksler/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
from /Users/mveksler/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
from /Users/mveksler/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
from /Users/mveksler/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from'
from /Users/mveksler/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:421:in `block in each_strongly_connected_component_from'
from /Users/mveksler/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/initializable.rb:44:in `each'
from /Users/mveksler/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/initializable.rb:44:in `tsort_each_child'
from /Users/mveksler/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:415:in `call'
from /Users/mveksler/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:415:in `each_strongly_connected_component_from'
from /Users/mveksler/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:421:in `block in each_strongly_connected_component_from'
from /Users/mveksler/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/initializable.rb:44:in `each'
from /Users/mveksler/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/initializable.rb:44:in `tsort_each_child'
from /Users/mveksler/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:415:in `call'
from /Users/mveksler/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:415:in `each_strongly_connected_component_from'
from /Users/mveksler/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component'
from /Users/mveksler/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:347:in `each'
from /Users/mveksler/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:347:in `call'
from /Users/mveksler/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component'%
from /Users/mveksler/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:226:in `tsort_each'
from /Users/mveksler/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:205:in `tsort_each'
from /Users/mveksler/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/mveksler/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/application.rb:352:in `initialize!'
from /Users/mveksler/Developer/referral-web/config/environment.rb:5:in `<top (required)>'
from /Users/mveksler/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require'
from /Users/mveksler/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `block in require'
from /Users/mveksler/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:240:in `load_dependency'
from /Users/mveksler/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require'
from /Users/mveksler/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-1.7.1/lib/spring/application.rb:92:in `preload'
from /Users/mveksler/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-1.7.1/lib/spring/application.rb:143:in `serve'
from /Users/mveksler/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-1.7.1/lib/spring/application.rb:131:in `block in run'
from /Users/mveksler/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-1.7.1/lib/spring/application.rb:125:in `loop'
from /Users/mveksler/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-1.7.1/lib/spring/application.rb:125:in `run'
from /Users/mveksler/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-1.7.1/lib/spring/application/boot.rb:19:in `<top (required)>'
from /Users/mveksler/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/mveksler/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'
What could be the reason for this?
ENV is not a class (or a module) it is a constant. This should work
def ENV.enabled?(env_key)
if ENV[env_key].nil?
return false
else
return ActiveRecord::ConnectionAdapters::Column::TRUE_VALUES.include?(ENV[env_key])
end
end
but I am not sure what you are trying to achieve. Are you just trying to call .enabled? on ENV
Edit: I should add that Classes and Module are also constants but my point is that it is not a Class or Module.

Rails 4 in action devise

Again I have a problem.
In chapter 6 Rails 4 in Action I generated Devise views with rails g devise:views and it was OK. Then I made some changes in .html files and wanted to run bundle exec rspec and got this error:
$ bundle exec rspec
bundler: failed to load command: rspec (/usr/local/bin/rspec)
NameError: uninitialized constant Devise
/home/rafal/ruby_workspace/ticketee/config/initializers/devise.rb:3:in `<top (required)>'
/usr/lib/ruby/vendor_ruby/rails/engine.rb:652:in `block in load_config_initializer'
/var/lib/gems/2.3.0/gems/activesupport-4.2.6/lib/active_support/notifications.rb:166:in `instrument'
/usr/lib/ruby/vendor_ruby/rails/engine.rb:651:in `load_config_initializer'
/usr/lib/ruby/vendor_ruby/rails/engine.rb:616:in `block (2 levels) in <class:Engine>'
/usr/lib/ruby/vendor_ruby/rails/engine.rb:615:in `each'
/usr/lib/ruby/vendor_ruby/rails/engine.rb:615:in `block in <class:Engine>'
/usr/lib/ruby/vendor_ruby/rails/initializable.rb:30:in `instance_exec'
/usr/lib/ruby/vendor_ruby/rails/initializable.rb:30:in `run'
/usr/lib/ruby/vendor_ruby/rails/initializable.rb:55:in `block in run_initializers'
/usr/lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each'
/usr/lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
/usr/lib/ruby/2.3.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
/usr/lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from'
/usr/lib/ruby/2.3.0/tsort.rb:421:in `block in each_strongly_connected_component_from'
/usr/lib/ruby/vendor_ruby/rails/initializable.rb:44:in `each'
/usr/lib/ruby/vendor_ruby/rails/initializable.rb:44:in `tsort_each_child'
/usr/lib/ruby/2.3.0/tsort.rb:415:in `call'
/usr/lib/ruby/2.3.0/tsort.rb:415:in `each_strongly_connected_component_from'
/usr/lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component'
/usr/lib/ruby/2.3.0/tsort.rb:347:in `each'
/usr/lib/ruby/2.3.0/tsort.rb:347:in `call'
/usr/lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component'
/usr/lib/ruby/2.3.0/tsort.rb:226:in `tsort_each'
/usr/lib/ruby/2.3.0/tsort.rb:205:in `tsort_each'
/usr/lib/ruby/vendor_ruby/rails/initializable.rb:54:in `run_initializers'
/usr/lib/ruby/vendor_ruby/rails/application.rb:352:in `initialize!'
/home/rafal/ruby_workspace/ticketee/config/environment.rb:5:in `<top (required)>'
/home/rafal/ruby_workspace/ticketee/spec/rails_helper.rb:4:in `require'
/home/rafal/ruby_workspace/ticketee/spec/rails_helper.rb:4:in `<top (required)>'
/home/rafal/ruby_workspace/ticketee/spec/controllers/projects_controller_spec.rb:1:in `require'
/home/rafal/ruby_workspace/ticketee/spec/controllers/projects_controller_spec.rb:1:in `<top (required)>'
/var/lib/gems/2.3.0/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1226:in `load'
/var/lib/gems/2.3.0/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1226:in `block in load_spec_files'
/var/lib/gems/2.3.0/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1224:in `each'
/var/lib/gems/2.3.0/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1224:in `load_spec_files'
/var/lib/gems/2.3.0/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:97:in `setup'
/var/lib/gems/2.3.0/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:85:in `run'
/var/lib/gems/2.3.0/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:70:in `run'
/var/lib/gems/2.3.0/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:38:in `invoke'
/var/lib/gems/2.3.0/gems/rspec-core-3.2.3/exe/rspec:4:in `<top (required)>'
/usr/local/bin/rspec:23:in `load'
/usr/local/bin/rspec:23:in `<top (required)>'
Could you help me?
The problem is that rspec doesn't load devise, to fix it, in your spec/rails_helper.rb file add require devise after require 'rspec/rails'

Curious ouput of rails controller generator

Cannot generate controller via (it doesn't appear in /app/controllers/) rails generate controller StaticPages
Output:
azureuser#host:~/railstutorial_apps/demo$ rails generate controller StaticPages --no-test-framework
/home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:268:in `load': /home/azureuser/railstutorial_
/home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:268:in `load': /home/azureuser/railst[0/1427]
apps/demo/config/initializers/session_store.rb:1: syntax error, unexpected keyword_when, expecting end-of-input
ure to restart your server when you modify this file.
^ (SyntaxError)
from /home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:268:in `block in load'
from /home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:240:in `load_dependency'
from /home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:268:in `load'
from /home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/railties-4.2.3/lib/rails/engine.rb:652:in `block in load_config_initializer'
from /home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/activesupport-4.2.3/lib/active_support/notifications.rb:166:in `instrument'
from /home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/railties-4.2.3/lib/rails/engine.rb:651:in `load_config_initializer'
from /home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/railties-4.2.3/lib/rails/engine.rb:616:in `block (2 levels) in <class:Engine>'
from /home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/railties-4.2.3/lib/rails/engine.rb:615:in `each'
from /home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/railties-4.2.3/lib/rails/engine.rb:615:in `block in <class:Engine>'
from /home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/railties-4.2.3/lib/rails/initializable.rb:30:in `instance_exec'
from /home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/railties-4.2.3/lib/rails/initializable.rb:30:in `run'
from /home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/railties-4.2.3/lib/rails/initializable.rb:55:in `block in run_initializers'
from /home/azureuser/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
from /home/azureuser/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
from /home/azureuser/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/tsort.rb:210:in `block (2 levels) in each_strongly_connected_component_from'
from /home/azureuser/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from'
from /home/azureuser/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/tsort.rb:209:in `block in each_strongly_connected_component_from'
from /home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/railties-4.2.3/lib/rails/initializable.rb:44:in `each'
from /home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/railties-4.2.3/lib/rails/initializable.rb:44:in `tsort_each_child'
from /home/azureuser/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/tsort.rb:203:in `each_strongly_connected_component_from'
from /home/azureuser/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component'
from /home/azureuser/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/tsort.rb:180:in `each'
from /home/azureuser/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component'
from /home/azureuser/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'
from /home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/railties-4.2.3/lib/rails/initializable.rb:54:in `run_initializers'
from /home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/railties-4.2.3/lib/rails/application.rb:352:in `initialize!'
from /home/azureuser/railstutorial_apps/demo/config/environment.rb:5:in `<top (required)>'
from /home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/spring-1.3.6/lib/spring/application.rb:92:in `require'
from /home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/spring-1.3.6/lib/spring/application.rb:92:in `preload'
from /home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/spring-1.3.6/lib/spring/application.rb:143:in `serve'
from /home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/spring-1.3.6/lib/spring/application.rb:131:in `block in run'
from /home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/spring-1.3.6/lib/spring/application.rb:125:in `loop'
from /home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/spring-1.3.6/lib/spring/application.rb:125:in `run'
from /home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/spring-1.3.6/lib/spring/application/boot.rb:18:in `<top (required)>'
from /home/azureuser/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /home/azureuser/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from -e:1:in `<main>'
azureuser#host:~/railstutorial_apps/demo$
As per my comment, there is an error in the config/initializers/session_store.rb. After you fix this error you will be able to generate the controller.

Resources