Autotest with Rspec2 in Rails 3 Can't Find Binaries

时间秒杀一切 提交于 2019-12-06 13:34:11

问题


I'm trying to get autotest back up and running after moving my project to rails 3. After upgrading to rspec 2.0.0.beta.22, I can't seem to run autotest. I get the following:

bundler: command not found: c:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.0.0.beta.22/bin/rspec

even though the binary does in fact exist in that location.

Here is my Gemfile contents:

group :development do
  gem 'webrat'
  gem 'rspec-rails', '>=2.0.0.beta.22'
  gem 'factory_girl_rails', '1.0'
  gem 'autotest'
end

group :test do
  gem 'webrat'
  gem 'rspec-rails', '>=2.0.0.beta.22'
  gem 'factory_girl_rails', '1.0'
  gem 'autotest'
end

and I have the following gems installed (among others):

  • autotest (4.3.2)
  • autotest-growl (0.2.5)
  • rspec (2.0.0.beta22)
  • rspec-core (2.0.0.beta22)
  • rspec-expectations (2.0.0.beta22)
  • rspec-mocks (2.0.0.beta22)
  • rspec-rails (2.0.0.beta22)
  • ZenTest (4.4.0)

Any idea what could be going on here?


回答1:


I am using JRuby ( with Rails 3) and I need to put the following in my PATH to fix this issue: jruby-1.5.2/lib/ruby/gems/1.8/bin

You should do something similar for your Ruby on Rails installation.




回答2:


This is how I remedied the issue:

I uninstalled all testing gems (rspec, factory_girl, webrat, etc). I then upgraded to rspec 2.0.1, uninstalled ZenTest (in favor of straight autotest). All of these installations were done outside of the bundler.

I have the following gem setup:

autotest (4.4.1)
autotest-growl (0.2.6)
factory_girl (1.3.2)
factory_girl_rails (1.0)
rspec (2.0.1)
rspec-core (2.0.1)
rspec-expectations (2.0.1)
rspec-mocks (2.0.1)
rspec-rails (2.0.1)
webrat (0.7.1)

I used the following in the Gemfile.

group :development, :test do
  gem 'rspec', '>=2.0.1'
  gem 'rspec-rails', '>=2.0.1'
  gem 'webrat'
  gem 'factory_girl_rails', '1.0'
end


来源:https://stackoverflow.com/questions/3766491/autotest-with-rspec2-in-rails-3-cant-find-binaries

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!