我正在尝试安装RSpec,以便在我没有编写的应用程序上进行一些测试。我已经把
gem "rspec-rails","~> 2.8“
在我的ran文件中运行了bundle安装。这个效果很好。直到我跑了
rails生成rspec:install
我知道这个错误:
/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)来自/Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.0.20/lib/action_dispatch/routing/mapper.rb:1309:inaction_path' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.0.20/lib/action_dispatch/routing/mapper.rb:1304:inpath_for_action’从/Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.0.20/lib/action_dispatch/routing/mapper.rb:1159:inmatch' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.0.20/lib/action_dispatch/routing/mapper.rb:1358:inmatch‘get /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.0.20/lib/action_dispatch/routing/mapper.rb:394:inmap_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 /User/anthonyto/ActiveNetwork/active-培训器/config/routeres.rb:447:在控制器中的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块中,“从/Users/anthonyto/ActiveNetwork/active-trainer/config/routes.rb:446:inscope' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.0.20/lib/action_dispatch/routing/mapper.rb:565:in控制器”到“名称空间中的/Users/anthonyto/ActiveNetwork/active-trainer/config/routes.rb:446:inblock (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块”,来自/Users/anthonyto/。rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.0.20/lib/action_dispatch/routing/mapper.rb:546:inscope' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.0.20/lib/action_dispatch/routing/mapper.rb:624:in命名空间‘来自/Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.0.20/lib/action_dispatch/routing/mapper.rb:1119:innamespace' from /Users/anthonyto/ActiveNetwork/active-trainer/config/routes.rb:406:in块(2个级别)’from /Users/anthonyto/..rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.0.20/lib/action_dispatch/routing/mapper.rb:624:inblock 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作用域“从/Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.0.20/lib/action_dispatch/routing/mapper.rb:624:innamespace' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.0.20/lib/action_dispatch/routing/mapper.rb:1119:in命名空间”到/Users/anthonyto/ActiveNetwork/active-trainer/config/routes.rb:405:in从/Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.0.20/lib/action_dispatch/routing/route_set.rb:239:indraw' from /Users/anthonyto/ActiveNetwork/active-trainer/config/routes.rb:1:in到/Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:236:inload' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:236: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:ininstance_exec‘load来自/Users/anthonyto的“从/Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:225:inblock in load_dependency' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:597:innew_constants_in”到/Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:225:inload_dependency' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:236:inload‘/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.20/lib/rails/application.rb:127:inblock in reload_routes!' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.20/lib/rails/application.rb:127:in各‘来自routes_reloader中的/Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.20/lib/rails/application.rb:127:inreload_routes!' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.20/lib/rails/application.rb:120:in块’来自/Users/anthonyto/..rvm/gems/ruby-1.9。3-p194/gems/activesupport-3.0.20/lib/active_support/file_update_checker.rb:32:incall' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.20/lib/active_support/file_update_checker.rb:32:inexecute_if_updated“/Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.20/lib/rails/application/finisher.rb:51:inblock (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:incall”来自/Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.20/lib/rails/application/finisher.rb:52:inblock in <module:Finisher>' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.20/lib/rails/initializable.rb:25:ininstance_exec从run_initializers中的/Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.20/lib/rails/initializable.rb:25:inrun' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.20/lib/rails/initializable.rb:50:in块到/Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.20/lib/rails/initializable.rb:49:ineach' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.20/lib/rails/initializable.rb:49:inrun_initializers‘frominitialize!' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.20/lib/rails/application.rb:77:inmethod_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:inrequire‘from /Users/anthonyto/..rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:242:inblock in require' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:225:inblock in load_dependency‘from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:597:innew_constants_in' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:225:inload_dependency’from /Users/anthonyto/..rvm/gems/ruby-1.9.3-p 194/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:242:inrequire' from /Users/anthonyto/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.20/lib/rails/application.rb:103:inrequire_environment!来自/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
我运行的是ruby版本1.9.3和rails版本3.0.20。我可以提供任何额外的信息,任何帮助都将非常感谢。谢谢大家!
编辑:当我试图启动我的rails服务器时,我得到了同样的错误。我的应用程序似乎有一个更深层次的问题。我以前当然没有这个问题,我想不出我做了什么事情会导致这个问题。
发布于 2013-06-10 23:26:17
修正:所以我搞清楚了到底是怎么回事,我会把它留给其他遇到这个恼人错误的人。原来我是个白痴,在routes.rb文件中留下了一些错误代码,如下所示:
控制器:日历要写#写一些路线在这里结束
评论一下,一切都很顺利。
https://stackoverflow.com/questions/16952195
复制相似问题