1
votes

I am trying to install RSpec to do some testing on an app that I did not write. I've placed

gem "rspec-rails", "~> 2.8"

in my gemfile and ran bundle install. This worked fine. Until I ran

rails generate rspec:install

I get this error:

/Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.20/lib/active_support/whiny_nil.rb:48:in method_missing': undefined methodto_sym' for nil:NilClass (NoMethodError) from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.0.20/lib/action_dispatch/routing/mapper.rb:1309:in action_path' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.0.20/lib/action_dispatch/routing/mapper.rb:1304:in path_for_action' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.0.20/lib/action_dispatch/routing/mapper.rb:1159:in match' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.0.20/lib/action_dispatch/routing/mapper.rb:1358:in match' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.0.20/lib/action_dispatch/routing/mapper.rb:394:in map_method' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.0.20/lib/action_dispatch/routing/mapper.rb:323:in get' from /Users/anthonyto/ActiveNetwork/active-trainer/config/routes.rb:447:in block (4 levels) in <top (required)>' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.0.20/lib/action_dispatch/routing/mapper.rb:565:in block in controller' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.0.20/lib/action_dispatch/routing/mapper.rb:546:in scope' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.0.20/lib/action_dispatch/routing/mapper.rb:565:in controller' from /Users/anthonyto/ActiveNetwork/active-trainer/config/routes.rb:446:in block (3 levels) in <top (required)>' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.0.20/lib/action_dispatch/routing/mapper.rb:624:in block in namespace' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.0.20/lib/action_dispatch/routing/mapper.rb:546:in scope' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.0.20/lib/action_dispatch/routing/mapper.rb:624:in namespace' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.0.20/lib/action_dispatch/routing/mapper.rb:1119:in namespace' from /Users/anthonyto/ActiveNetwork/active-trainer/config/routes.rb:406:in block (2 levels) in ' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.0.20/lib/action_dispatch/routing/mapper.rb:624:in block in namespace' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.0.20/lib/action_dispatch/routing/mapper.rb:546:in scope' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.0.20/lib/action_dispatch/routing/mapper.rb:624:in namespace' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.0.20/lib/action_dispatch/routing/mapper.rb:1119:in namespace' from /Users/anthonyto/ActiveNetwork/active-trainer/config/routes.rb:405:in block in <top (required)>' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.0.20/lib/action_dispatch/routing/route_set.rb:239:in instance_exec' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.0.20/lib/action_dispatch/routing/route_set.rb:239:in draw' from /Users/anthonyto/ActiveNetwork/active-trainer/config/routes.rb:1:in ' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:236:in load' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:236:in block in load' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:225:in block in load_dependency' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:597:in new_constants_in' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:225:in load_dependency' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:236:in load' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.20/lib/rails/application.rb:127:in block in reload_routes!' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.20/lib/rails/application.rb:127:in each' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.20/lib/rails/application.rb:127:in reload_routes!' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.20/lib/rails/application.rb:120:in block in routes_reloader' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.20/lib/active_support/file_update_checker.rb:32:in call' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.20/lib/active_support/file_update_checker.rb:32:in execute_if_updated' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.20/lib/rails/application/finisher.rb:51:in block (2 levels) in <module:Finisher>' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.20/lib/rails/application/finisher.rb:52:in call' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.20/lib/rails/application/finisher.rb:52:in block in <module:Finisher>' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.20/lib/rails/initializable.rb:25:in instance_exec' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.20/lib/rails/initializable.rb:25:in run' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.20/lib/rails/initializable.rb:50:in block in run_initializers' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.20/lib/rails/initializable.rb:49:in each' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.20/lib/rails/initializable.rb:49:in run_initializers' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.20/lib/rails/application.rb:134:in initialize!' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.20/lib/rails/application.rb:77:in method_missing' from /Users/anthonyto/ActiveNetwork/active-trainer/config/environment.rb:5:in <top (required)>' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:242:in require' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:242:in block in require' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:225:in block in load_dependency' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:597:in new_constants_in' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:225:in load_dependency' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:242:in require' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.20/lib/rails/application.rb:103:in require_environment!' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.20/lib/rails/commands.rb:16:in <top (required)>' from script/rails:7:inrequire' from script/rails:7:in `'

I am running ruby version 1.9.3 and rails version 3.0.20. I can provide any additional information, any help would be very greatly appreciated. Thank you all!

EDIT: Turns out I am getting this same error when I try to start my rails server. Seems like there is a deeper issue with my app. I certainly did not have this issue before, and cannot think of anything I did that would've caused it.

1
Please post your fix as an answser for closure.Seeta Somagani
Looks like I have to wait another 5 hours to do so, because my reputation is not high enough. But will do, thanks.user2426967

1 Answers

0
votes

FIX: So I figured out what was going on, i'll leave it here for anyone else that runs into this annoying error. Turns out I was being an idiot and left some faulty code in the routes.rb file that looked like this:

  controller :calendar do
    get #write some routes here
  end

Commented that out, and everything worked fine.