尝试使用bundler和rvm安装rspec。错误:未定义的方法'spec'

时间:2011-01-29 03:59:55

标签: ruby-on-rails rspec bundler rvm

Rails 2.3.8,bundler 1.0.9。

我一直收到错误:

/Users/dwalseth/.rvm/gems/ruby-1.8.7-p330@rails2/gems/bundler-1.0.9/lib/bundler/source.rb:72:in fetch': undefined methodspec' for nil:NilClass (NoMethodError)
    from /Users/dwalseth/.rvm/gems/ruby-1.8.7-p330@rails2/gems/bundler-1.0.9/lib/bundler/installer.rb:45:in run'
    from /Users/dwalseth/.rvm/gems/ruby-1.8.7-p330@rails2/gems/bundler-1.0.9/lib/bundler/spec_set.rb:12:ineach'
    from /Users/dwalseth/.rvm/gems/ruby-1.8.7-p330@rails2/gems/bundler-1.0.9/lib/bundler/spec_set.rb:12:in each'
    from /Users/dwalseth/.rvm/gems/ruby-1.8.7-p330@rails2/gems/bundler-1.0.9/lib/bundler/installer.rb:44:inrun'
    from /Users/dwalseth/.rvm/gems/ruby-1.8.7-p330@rails2/gems/bundler-1.0.9/lib/bundler/installer.rb:8:in install'
    from /Users/dwalseth/.rvm/gems/ruby-1.8.7-p330@rails2/gems/bundler-1.0.9/lib/bundler/cli.rb:225:ininstall'
    from /Users/dwalseth/.rvm/gems/ruby-1.8.7-p330@rails2/gems/bundler-1.0.9/lib/bundler/vendor/thor/task.rb:22:in send'
    from /Users/dwalseth/.rvm/gems/ruby-1.8.7-p330@rails2/gems/bundler-1.0.9/lib/bundler/vendor/thor/task.rb:22:inrun'
    from /Users/dwalseth/.rvm/gems/ruby-1.8.7-p330@rails2/gems/bundler-1.0.9/lib/bundler/vendor/thor/invocation.rb:118:in invoke_task'
    from /Users/dwalseth/.rvm/gems/ruby-1.8.7-p330@rails2/gems/bundler-1.0.9/lib/bundler/vendor/thor.rb:246:indispatch'
    from /Users/dwalseth/.rvm/gems/ruby-1.8.7-p330@rails2/gems/bundler-1.0.9/lib/bundler/vendor/thor/base.rb:389:in start'
    from /Users/dwalseth/.rvm/gems/ruby-1.8.7-p330@rails2/gems/bundler-1.0.9/bin/bundle:13
    from /Users/dwalseth/.rvm/gems/ruby-1.8.7-p330@rails2/bin/bundle:19:inload'
    from /Users/dwalseth/.rvm/gems/ruby-1.8.7-p330@rails2/bin/bundle:19

这是我的Gemfile:

fetch': undefined method

注意,当我指定其他一些安装目录时,例如

run'
    from /Users/dwalseth/.rvm/gems/ruby-1.8.7-p330@rails2/gems/bundler-1.0.9/lib/bundler/spec_set.rb:12:in
它安装好捆绑。

我不能为我的生活搞清楚!

1 个答案:

答案 0 :(得分:1)

最新的rspec不支持Rails 2.3.8。您需要加载rspec版本1.3.1。

有关详细信息,请参阅http://cheat.errtheblog.com/s/rspec/