Rails Generate command error - ruby-on-rails

I am using Rails version 4.2.7.1 and ruby 2.2.5 with rvm.
After bundle update I cannot run rails g command anymore.
The following error keeps appearing:
-- [](4.2)
/Users/Sergei/.rvm/gems/ruby-2.2.5#rails4/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:664:in `block in method_missing': undefined method `[]' for #<ActiveRecord::Migration:0x007fce8f996460> (NoMethodError)
from /Users/Sergei/.rvm/gems/ruby-2.2.5#rails4/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:634:in `block in say_with_time'
from /Users/Sergei/.rvm/rubies/ruby-2.2.5/lib/ruby/2.2.0/benchmark.rb:288:in `measure'
from /Users/Sergei/.rvm/gems/ruby-2.2.5#rails4/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:634:in `say_with_time'
from /Users/Sergei/.rvm/gems/ruby-2.2.5#rails4/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:654:in `method_missing'
from /Users/Sergei/.rvm/gems/ruby-2.2.5#rails4/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:416:in `method_missing'
from /Users/Sergei/.rvm/gems/ruby-2.2.5#rails4/gems/encrypted_store-0.3.0/lib/generators/encrypted_store/upgrade/ZeroOneFive/templates/upgrade_encryption_keys_to_015.rb:1:in `<top (required)>'
from /Users/Sergei/.rvm/gems/ruby-2.2.5#rails4/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'
from /Users/Sergei/.rvm/gems/ruby-2.2.5#rails4/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `block in require'
from /Users/Sergei/.rvm/gems/ruby-2.2.5#rails4/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:240:in `load_dependency'
from /Users/Sergei/.rvm/gems/ruby-2.2.5#rails4/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'
from /Users/Sergei/.rvm/gems/ruby-2.2.5#rails4/gems/encrypted_store-0.3.0/lib/encrypted_store/railtie.rb:18:in `block (2 levels) in <class:Railtie>'
from /Users/Sergei/.rvm/gems/ruby-2.2.5#rails4/gems/encrypted_store-0.3.0/lib/encrypted_store/railtie.rb:18:in `each'
from /Users/Sergei/.rvm/gems/ruby-2.2.5#rails4/gems/encrypted_store-0.3.0/lib/encrypted_store/railtie.rb:18:in `block in <class:Railtie>'
from /Users/Sergei/.rvm/gems/ruby-2.2.5#rails4/gems/railties-4.2.7.1/lib/rails/railtie.rb:228:in `call'
from /Users/Sergei/.rvm/gems/ruby-2.2.5#rails4/gems/railties-4.2.7.1/lib/rails/railtie.rb:228:in `block in run_generators_blocks'
from /Users/Sergei/.rvm/gems/ruby-2.2.5#rails4/gems/railties-4.2.7.1/lib/rails/railtie.rb:245:in `each'
from /Users/Sergei/.rvm/gems/ruby-2.2.5#rails4/gems/railties-4.2.7.1/lib/rails/railtie.rb:245:in `each_registered_block'
from /Users/Sergei/.rvm/gems/ruby-2.2.5#rails4/gems/railties-4.2.7.1/lib/rails/railtie.rb:228:in `run_generators_blocks'
from /Users/Sergei/.rvm/gems/ruby-2.2.5#rails4/gems/railties-4.2.7.1/lib/rails/application.rb:462:in `block in run_generators_blocks'
from /Users/Sergei/.rvm/gems/ruby-2.2.5#rails4/gems/railties-4.2.7.1/lib/rails/engine/railties.rb:13:in `each'
from /Users/Sergei/.rvm/gems/ruby-2.2.5#rails4/gems/railties-4.2.7.1/lib/rails/engine/railties.rb:13:in `each'
from /Users/Sergei/.rvm/gems/ruby-2.2.5#rails4/gems/railties-4.2.7.1/lib/rails/application.rb:462:in `run_generators_blocks'
from /Users/Sergei/.rvm/gems/ruby-2.2.5#rails4/gems/railties-4.2.7.1/lib/rails/engine.rb:461:in `load_generators'
from /Users/Sergei/.rvm/gems/ruby-2.2.5#rails4/gems/railties-4.2.7.1/lib/rails/commands/commands_tasks.rb:129:in `generate_or_destroy'
from /Users/Sergei/.rvm/gems/ruby-2.2.5#rails4/gems/railties-4.2.7.1/lib/rails/commands/commands_tasks.rb:50:in `generate'
from /Users/Sergei/.rvm/gems/ruby-2.2.5#rails4/gems/railties-4.2.7.1/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /Users/Sergei/.rvm/gems/ruby-2.2.5#rails4/gems/railties-4.2.7.1/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
Already tried reinstalling gemset and deleting all previous migration files, but it did not help. What could be the reason?

OK! I solved by myself. As I could see from this line
from /Users/Sergei/.rvm/gems/ruby-2.2.5#rails4/gems/encrypted_store-0.3.0/lib/generators/encrypted_store/upgrade/ZeroOneFive/templates/upgrade_encryption_keys_to_015.rb:1:in `<top (required)>'
It had dependency from gem encrypted_store. I removed this gem from Gemfile and reinstalled in with bundle command (gem 'encrypted_store', '~> 0.2.8'). After this the error was gone.

Related

Deprecation error for rails stopping me from launching rails server

I am doing some open source stuff for the rails app https://github.com/publiclab/mapknitter but when I try to launch the rails server using rails s I get the following error message:
DEPRECATION WARNING: Support for Rails versions before 4.2 is deprecated and will be removed from skylight 2.0. (called from require at /Users/bena/.rvm/rubies/ruby-2.4.6/lib/ruby/site_ruby/2.4.0/bundler/runtime.rb:81)
=> Booting WEBrick
=> Rails 3.2.22.5 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[SKYLIGHT] [1.7.2] Running Skylight in development mode. No data will be reported until you deploy your app.
(To disable this message for all local apps, run `skylight disable_dev_warning`.)
Exiting
/Users/bena/.rvm/gems/ruby-2.4.6/gems/railties-3.2.22.5/lib/rails/application/configuration.rb:115:in `read': No such file or directory # rb_sysopen - /Users/bena/Documents/repos/ben-repos/mapknitter/config/database.yml (Errno::ENOENT)
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/railties-3.2.22.5/lib/rails/application/configuration.rb:115:in `database_configuration'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/activerecord-3.2.22.5/lib/active_record/railtie.rb:84:in `block (2 levels) in <class:Railtie>'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/activesupport-3.2.22.5/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/activesupport-3.2.22.5/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/activesupport-3.2.22.5/lib/active_support/lazy_load_hooks.rb:43:in `block in run_load_hooks'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/activesupport-3.2.22.5/lib/active_support/lazy_load_hooks.rb:42:in `each'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/activesupport-3.2.22.5/lib/active_support/lazy_load_hooks.rb:42:in `run_load_hooks'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/activerecord-3.2.22.5/lib/active_record/base.rb:720:in `<top (required)>'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/skylight-1.7.2/lib/skylight/probes.rb:119:in `require'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/skylight-1.7.2/lib/skylight/probes.rb:119:in `require'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:251:in `block in require'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:236:in `load_dependency'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:251:in `require'
from /Users/bena/Documents/repos/ben-repos/mapknitter/config/initializers/column_definition.rb:19:in `<class:ColumnDefinition>'
from /Users/bena/Documents/repos/ben-repos/mapknitter/config/initializers/column_definition.rb:17:in `<top (required)>'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:245:in `load'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:245:in `block in load'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:236:in `load_dependency'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:245:in `load'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/railties-3.2.22.5/lib/rails/engine.rb:593:in `block (2 levels) in <class:Engine>'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/railties-3.2.22.5/lib/rails/engine.rb:592:in `each'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/railties-3.2.22.5/lib/rails/engine.rb:592:in `block in <class:Engine>'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/railties-3.2.22.5/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/railties-3.2.22.5/lib/rails/initializable.rb:30:in `run'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/railties-3.2.22.5/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/railties-3.2.22.5/lib/rails/initializable.rb:54:in `each'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/railties-3.2.22.5/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/railties-3.2.22.5/lib/rails/application.rb:136:in `initialize!'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/railties-3.2.22.5/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /Users/bena/Documents/repos/ben-repos/mapknitter/config/environment.rb:5:in `<top (required)>'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/skylight-1.7.2/lib/skylight/probes.rb:119:in `require'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/skylight-1.7.2/lib/skylight/probes.rb:119:in `require'
from /Users/bena/Documents/repos/ben-repos/mapknitter/config.ru:3:in `block in <main>'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/rack-1.4.7/lib/rack/builder.rb:51:in `instance_eval'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/rack-1.4.7/lib/rack/builder.rb:51:in `initialize'
from /Users/bena/Documents/repos/ben-repos/mapknitter/config.ru:in `new'
from /Users/bena/Documents/repos/ben-repos/mapknitter/config.ru:in `<main>'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/rack-1.4.7/lib/rack/builder.rb:40:in `eval'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/rack-1.4.7/lib/rack/builder.rb:40:in `parse_file'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/rack-1.4.7/lib/rack/server.rb:200:in `app'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/railties-3.2.22.5/lib/rails/commands/server.rb:46:in `app'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/rack-1.4.7/lib/rack/server.rb:304:in `wrapped_app'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/rack-1.4.7/lib/rack/server.rb:254:in `start'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/railties-3.2.22.5/lib/rails/commands/server.rb:70:in `start'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/railties-3.2.22.5/lib/rails/commands.rb:55:in `block in <top (required)>'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/railties-3.2.22.5/lib/rails/commands.rb:50:in `tap'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/railties-3.2.22.5/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Is the problem caused by the the version of rails I am using or the version of skylight or something else entirely?
I am using ruby 2.4.6p354 and rails 3.2.22.5
I have installed and tried to switch to rails 4.2.0 but that doesn't seem to be working, I think because in the gemfile there is a pessimistic version constraint of gem "rails" ,"~>3.2" but I could be completely wrong. I have been told not to change the gemfile.
Check first line in error backtrace. You dont have /config/database.yml in your project
No such file or directory # rb_sysopen -
/Users/bena/Documents/repos/ben-repos/mapknitter/config/database.yml
(Errno::ENOENT)
Make sure you install everything from Prerequisites and simply follow Installation guide

undefined method `eager_load' when upgrading to formtastic 3.1

I'm using Ruby 1.9.3 and Rails 3.2.17 for this project. I plan to upgrade to Rails 4 but meet a lot gem incompatibilities, so I try to update some gem at first.
I am updating formtastic from 2.0.2 to 3.1.3.
I see a lot of deprecation warnings like this:
DEPRECATION WARNING: input_class is deprecated and will be removed from Formtastic 4.0 (configure Formtastic::FormBuilder.input_class_finder instead (upgrade guide on wiki: http://bit.ly/1F9QtKc )). (called from _app_views_prescriptions__fields_html_haml___278490936240938991_103076320 at /home/hegwin/Workspace/rails_projects/pharmmd/app/views/prescriptions/_fields.html.haml:7)
And I followed formtastic wiki Upgrading to Formtastic 3.1 , and I added these two lines to config/initializers/formtastic.rb
Formtastic::FormBuilder.action_class_finder = Formtastic::ActionClassFinder
Formtastic::FormBuilder.input_class_finder = Formtastic::InputClassFinder
After that when I tried to run the rspec, it threw an error:
NoMethodError: undefined method `eager_load' for #<Rails::Application::Configuration:0x00000006306a50>
/home/hegwin/.rvm/gems/ruby-1.9.3-p362#medpro/gems/railties-3.2.17/lib/rails/railtie/configuration.rb:85:in `method_missing': undefined method `eager_load' for #<Rails::Application::Configuration:0x00000006459b50> (NoMethodError)
from /home/hegwin/.rvm/gems/ruby-1.9.3-p362#medpro/gems/formtastic-3.1.3/lib/formtastic/namespaced_class_finder.rb:32:in `use_const_defined?'
from /home/hegwin/.rvm/gems/ruby-1.9.3-p362#medpro/gems/formtastic-3.1.3/lib/formtastic/namespaced_class_finder.rb:69:in `<class:NamespacedClassFinder>'
from /home/hegwin/.rvm/gems/ruby-1.9.3-p362#medpro/gems/formtastic-3.1.3/lib/formtastic/namespaced_class_finder.rb:24:in `<module:Formtastic>'
from /home/hegwin/.rvm/gems/ruby-1.9.3-p362#medpro/gems/formtastic-3.1.3/lib/formtastic/namespaced_class_finder.rb:1:in `<top (required)>'
from /home/hegwin/.rvm/gems/ruby-1.9.3-p362#medpro/gems/formtastic-3.1.3/lib/formtastic/action_class_finder.rb:7:in `<module:Formtastic>'
from /home/hegwin/.rvm/gems/ruby-1.9.3-p362#medpro/gems/formtastic-3.1.3/lib/formtastic/action_class_finder.rb:1:in `<top (required)>'
from /home/hegwin/Workspace/rails_projects/pharmmd/config/initializers/formtastic.rb:104:in `<top (required)>'
from /home/hegwin/.rvm/gems/ruby-1.9.3-p362#medpro/gems/zeus-0.13.3/lib/zeus/load_tracking.rb:50:in `load'
from /home/hegwin/.rvm/gems/ruby-1.9.3-p362#medpro/gems/zeus-0.13.3/lib/zeus/load_tracking.rb:50:in `load'
from /home/hegwin/.rvm/gems/ruby-1.9.3-p362#medpro/gems/zeus-0.13.3/lib/zeus/load_tracking.rb:43:in `load'
from /home/hegwin/.rvm/gems/ruby-1.9.3-p362#medpro/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:245:in `block in load'
from /home/hegwin/.rvm/gems/ruby-1.9.3-p362#medpro/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:236:in `load_dependency'
from /home/hegwin/.rvm/gems/ruby-1.9.3-p362#medpro/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:245:in `load'
from /home/hegwin/.rvm/gems/ruby-1.9.3-p362#medpro/gems/railties-3.2.17/lib/rails/engine.rb:593:in `block (2 levels) in <class:Engine>'
from /home/hegwin/.rvm/gems/ruby-1.9.3-p362#medpro/gems/railties-3.2.17/lib/rails/engine.rb:592:in `each'
from /home/hegwin/.rvm/gems/ruby-1.9.3-p362#medpro/gems/railties-3.2.17/lib/rails/engine.rb:592:in `block in <class:Engine>'
from /home/hegwin/.rvm/gems/ruby-1.9.3-p362#medpro/gems/railties-3.2.17/lib/rails/initializable.rb:30:in `instance_exec'
from /home/hegwin/.rvm/gems/ruby-1.9.3-p362#medpro/gems/railties-3.2.17/lib/rails/initializable.rb:30:in `run'
from /home/hegwin/.rvm/gems/ruby-1.9.3-p362#medpro/gems/railties-3.2.17/lib/rails/initializable.rb:55:in `block in run_initializers'
from /home/hegwin/.rvm/gems/ruby-1.9.3-p362#medpro/gems/railties-3.2.17/lib/rails/initializable.rb:54:in `each'
from /home/hegwin/.rvm/gems/ruby-1.9.3-p362#medpro/gems/railties-3.2.17/lib/rails/initializable.rb:54:in `run_initializers'
from /home/hegwin/.rvm/gems/ruby-1.9.3-p362#medpro/gems/railties-3.2.17/lib/rails/application.rb:136:in `initialize!'
from /home/hegwin/.rvm/gems/ruby-1.9.3-p362#medpro/gems/railties-3.2.17/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /home/hegwin/Workspace/rails_projects/pharmmd/config/environment.rb:5:in `<top (required)>'
from /home/hegwin/Workspace/rails_projects/pharmmd/spec/spec_helper.rb:12:in `require'
from /home/hegwin/Workspace/rails_projects/pharmmd/spec/spec_helper.rb:12:in `<top (required)>'
from /home/hegwin/Workspace/rails_projects/pharmmd/spec/features/patient_edit_medication.feature:1:in `require'
from /home/hegwin/Workspace/rails_projects/pharmmd/spec/features/patient_edit_medication.feature:1:in `<top (required)>'
from /home/hegwin/.rvm/gems/ruby-1.9.3-p362#medpro/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:819:in `load'
from /home/hegwin/.rvm/gems/ruby-1.9.3-p362#medpro/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:819:in `block in load_spec_files'
from /home/hegwin/.rvm/gems/ruby-1.9.3-p362#medpro/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:819:in `each'
from /home/hegwin/.rvm/gems/ruby-1.9.3-p362#medpro/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:819:in `load_spec_files'
from /home/hegwin/.rvm/gems/ruby-1.9.3-p362#medpro/gems/rspec-core-2.13.1/lib/rspec/core/command_line.rb:22:in `run'
from /home/hegwin/.rvm/gems/ruby-1.9.3-p362#medpro/gems/rspec-core-2.13.1/lib/rspec/core/runner.rb:80:in `run'
from /home/hegwin/.rvm/gems/ruby-1.9.3-p362#medpro/gems/rspec-core-2.13.1/lib/rspec/core/runner.rb:17:in `block in autorun'
The issue is known to the formtastic team. See issues #1137 and #1135 for details. In short, a stop-gap measure is to utilize the issue_1135 branch of the sepastian fork. Here's the Gemfile line:
gem 'formtastic', :git => 'git://github.com/sepastian/formtastic.git', :branch => 'issue_1135'
A better idea is to fork that branch to create your own repository.

rails server not starting after switching form version 4 to version 3

I am using rails version 3.2.6 and i recently downgraded from 4.0 because i wanted to work on a 3 version environment because the tutorial im following they are using version 3.
I am on a windows 7 machine and this is what i have done so far.
i first did gem install rails -v 3.2.6
then i did gem uninstall rails, and chose the version i wanted to install.
i then downgraded the gem that were dependent on rails version 4 and i was not getting any errors when running bundle install.
now when i try to do rails s to see what broke on my page the server never starts and i get a bunch of file names:
=> Booting WEBrick
=> Rails 3.2.6 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activerecord-3.2.6/lib/active_record/dynamic_matchers.rb:50:in `method_missing'C:/Ruby200- x64/lib/ruby/gems/2.0.0/gems/orm_adapter-0.5.0/lib/orm_adapter/adapters/active_record.rb:81: warning: already initialized constant ActiveRecord::Base::OrmAdapter
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/orm_adapter-0.5.0/lib/orm_adapter/adapters/active_record.rb:81: warning: previous definition of OrmAdapter was here
: undefined method `migration_error=' for #<Class:0x000000053c7850> (NoMethodError)
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activerecord-3.2.6/lib/active_record/railtie.rb:66:in `block (3 levels) in <class:Railtie>'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activerecord-3.2.6/lib/active_record/railtie.rb:65:in `each'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activerecord-3.2.6/lib/active_record/railtie.rb:65:in `block (2 levels) in <class:Railtie>'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:43:in `block in run_load_hooks'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:42:in `each'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:42:in `run_load_hooks'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activerecord-3.2.6/lib/active_record/base.rb:721:in `<top (required)>'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/devise-3.2.4/lib/devise/orm/active_record.rb:3:in `<top (required)>'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:in `require'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:in `block in require'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:236:in `load_dependency'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:in `require'
from C:/Users/Beans/Desktop/TestMaker/config/initializers/devise.rb:22:in `block in <top (required)>'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/devise-3.2.4/lib/devise.rb:288:in `setup'
from C:/Users/Beans/Desktop/TestMaker/config/initializers/devise.rb:3:in `<top (required)>'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:245:in `load'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:245:in `block in load'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:236:in `load_dependency'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:245:in `load'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-3.2.6/lib/rails/engine.rb:588:in `block (2 levels) in <class:Engine>'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-3.2.6/lib/rails/engine.rb:587:in `each'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-3.2.6/lib/rails/engine.rb:587:in `block in <class:Engine>'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-3.2.6/lib/rails/initializable.rb:30:in `instance_exec'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-3.2.6/lib/rails/initializable.rb:30:in `run'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-3.2.6/lib/rails/initializable.rb:55:in `block in run_initializers'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-3.2.6/lib/rails/initializable.rb:54:in `each'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-3.2.6/lib/rails/initializable.rb:54:in `run_initializers'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-3.2.6/lib/rails/application.rb:136:in `initialize!'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-3.2.6/lib/rails/railtie/configurable.rb:30:in `method_missing'
from C:/Users/Beans/Desktop/TestMaker/config/environment.rb:5:in `<top (required)>'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:in `require'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:in `block in require'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:236:in `load_dependency'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:in `require'
from C:/Users/Beans/Desktop/TestMaker/config.ru:3:in `block in <main>'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize'
from C:/Users/Beans/Desktop/TestMaker/config.ru:in `new'
from C:/Users/Beans/Desktop/TestMaker/config.ru:in `<main>'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rack-1.4.5/lib/rack/builder.rb:40:in `eval'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rack-1.4.5/lib/rack/builder.rb:40:in `parse_file'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rack-1.4.5/lib/rack/server.rb:200:in `app'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-3.2.6/lib/rails/commands/server.rb:46:in `app'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rack-1.4.5/lib/rack/server.rb:304:in `wrapped_app'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rack-1.4.5/lib/rack/server.rb:254:in `start'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-3.2.6/lib/rails/commands/server.rb:70:in `start'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-3.2.6/lib/rails/commands.rb:55:in `block in <top (required)>'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-3.2.6/lib/rails/commands.rb:50:in `tap'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-3.2.6/lib/rails/commands.rb:50:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
i know this might be a bunch of garbage to some, but if someone could help me that would be awesome. if you need more information, please let me know.
thank you in advance.
Since i am using rails on windows, RVM does not work, so i used the pik gem and with that i changed my environment to 3.2.6 and then it worked fine.

undefined method `paths' for #<Rails::Application::RoutesReloader:0xac73454> (NoMethodError)

I am getting this error when I run bundle exec cucumber. Is this a rails version error? How can I check if the rails being used has this method defined in the Rails::Application::RoutesReloader class to see if I need to upgrade/downgrade? If not, anyone have any suggestions?
Edit:
Stack Trace:
undefined method `paths' for #<Rails::Application::RoutesReloader:0xac73454> (NoMethodError)
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/engine.rb:517:in `block in <class:Engine>'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/initializable.rb:25:in `instance_exec'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/initializable.rb:25:in `run'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/initializable.rb:50:in `block in run_initializers'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/initializable.rb:49:in `each'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/initializable.rb:49:in `run_initializers'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/application.rb:92:in `initialize!'
/usr/local/lib/ruby/gems/1.9.1/gems/cucumber-rails-1.3.0/lib/cucumber/rails/application.rb:15:in `initialize!'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
/home/ubuntu/hw3_rottenpotatoes/config/environment.rb:5:in `<top (required)>'
/usr/local/lib/ruby/gems/1.9.1/gems/cucumber-rails-1.3.0/lib/cucumber/rails.rb:7:in `require'
/usr/local/lib/ruby/gems/1.9.1/gems/cucumber-rails-1.3.0/lib/cucumber/rails.rb:7:in `<top (required)>'
/home/ubuntu/hw3_rottenpotatoes/features/support/env.rb:7:in `require'
/home/ubuntu/hw3_rottenpotatoes/features/support/env.rb:7:in `<top (required)>'
/usr/local/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/rb_support/rb_language.rb:129:in `load'
/usr/local/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/rb_support/rb_language.rb:129:in `load_code_file'
/usr/local/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/runtime/support_code.rb:171:in `load_file'
/usr/local/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/runtime/support_code.rb:83:in `block in load_files!'
/usr/local/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/runtime/support_code.rb:82:in `each'
/usr/local/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/runtime/support_code.rb:82:in `load_files!'
/usr/local/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/runtime.rb:175:in `load_step_definitions'
/usr/local/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/runtime.rb:40:in `run!'
/usr/local/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/cli/main.rb:43:in `execute!'
/usr/local/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/cli/main.rb:20:in `execute'
/usr/local/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/bin/cucumber:14:in `<top (required)>'
/usr/local/bin/cucumber:19:in `load'
/usr/local/bin/cucumber:19:in `<main>'
I believe it is an error with rails because when I try to run rails server, it gives me the same error. Something must have happened to the installation because that command ran before without a problem

rail console test issue

I'm running Rails 3.2.1 and going through the railstutorial.org Chapter 6 secion of running in a test environment. After typing in "rails console test," the following commands are generated:
/Users/fanattix/rails_projects/sample_app/app/assets/stylesheets/joshuaclayton-blueprint-css-9bf9513/features/step_definitions/blueprint_steps.rb:1:in `<top (required)>': undefined method `When' for main:Object (NoMethodError)
from /Users/fanattix/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in `require'
from /Users/fanattix/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in `block in require'
from /Users/fanattix/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:236:in `load_dependency'
from /Users/fanattix/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in `require'
from /Users/fanattix/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:359:in `require_or_load'
from /Users/fanattix/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:313:in `depend_on'
from /Users/fanattix/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:225:in `require_dependency'
from /Users/fanattix/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.1/lib/rails/engine.rb:439:in `block (2 levels) in eager_load!'
from /Users/fanattix/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.1/lib/rails/engine.rb:438:in `each'
from /Users/fanattix/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.1/lib/rails/engine.rb:438:in `block in eager_load!'
from /Users/fanattix/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.1/lib/rails/engine.rb:436:in `each'
from /Users/fanattix/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.1/lib/rails/engine.rb:436:in `eager_load!'
from /Users/fanattix/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.1/lib/rails/application/finisher.rb:53:in `block in <module:Finisher>'
from /Users/fanattix/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.1/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/fanattix/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.1/lib/rails/initializable.rb:30:in `run'
from /Users/fanattix/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.1/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/fanattix/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.1/lib/rails/initializable.rb:54:in `each'
from /Users/fanattix/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.1/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/fanattix/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.1/lib/rails/application.rb:136:in `initialize!'
from /Users/fanattix/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.1/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /Users/fanattix/rails_projects/sample_app/config/environment.rb:5:in `<top (required)>'
from /Users/fanattix/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.1/lib/rails/application.rb:103:in `require'
from /Users/fanattix/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.1/lib/rails/application.rb:103:in `require_environment!'
from /Users/fanattix/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.1/lib/rails/commands.rb:40:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I've been running in "development" environment just fine. It's when I try to run in test as well as production that the problems occur.
It looks like you might have a gem in your Gemfile in the :development group that's absent in the :test group.

Resources