我正在学习 Ruby 和 Rails。我似乎安装了 3 个版本的 rspec gem。
rspec (2.8.0, 2.7.0, 2.6.0)
rspec-core (2.8.0, 2.7.1, 2.7.0, 2.6.4)
rspec-expectations (2.8.0, 2.7.0, 2.6.0)
rspec-mocks (2.8.0, 2.7.0, 2.6.0)
我输入:
$ rspec spec
它应该运行目录规范中的所有规范。我收到以下错误:
/Users/Cathy/.rvm/gems/ruby-1.9.3-p0/bin/rspec:
/Users/Cathy/.rvm/rubies/ruby-1.9.2-p290/bin/ruby:
bad interpreter: No such file or directory
我对错误的猜测是 rspec 无法判断要使用哪个版本的 gem。我想我需要设置一个gemfile。有没有比我更好的方向或更好的答案?
我在最新的 MacBook Pro 上运行 ruby 1.9.3p0(2011-10-30 修订版 33570)[x86_64-darwin11.2.0]。