2
我無法自動測試工作。 Rspec工作正常。安裝自動測試庫找不到錯誤
首先,我無法得到autotest/Rspec命令與bundle exec命令一起使用,所以我修改了Gemfile以包含以下代碼。
source 'http://rubygems.org'
gem 'rails', '3.0.7'
gem 'sqlite3-ruby', '1.3.2', :require => 'sqlite3'
group :development do
gem 'rspec-rails', '2.5.0'
end
group :test do
gem 'rspec', '2.5.0'
gem 'webrat', '0.7.1'
end
group :development, :test do
gem 'autotest'
end
然後我試圖安裝自動測試,
$ [sudo] gem install autotest -v 4.4.6
我碰到下面的錯誤。
Successfully installed autotest-4.4.6
1 gem installed
Installing ri documentation for autotest-4.4.6...
File not found: lib
ERROR: While generating documentation for autotest-4.4.6
... MESSAGE: exit
... RDOC args: --ri --op /Library/Ruby/Gems/1.8/doc/autotest-4.4.6/ri --main README.txt lib History.txt Manifest.txt README.txt --title autotest-4.4.6 Documentation --quiet
而隨後我安裝的低吼和fsevent
$ [sudo] gem install autotest-rails-pure -v 4.1.2
$ [sudo] gem install autotest-fsevent -v 0.2.4
$ [sudo] gem install autotest-growl -v 0.2.9
這些得到了安裝
我修改了我的根目錄下的文件.autotest,
require 'autotest-growl'
require 'autotest-fsevent'
現在,當我嘗試運行
$ bundle exec autotest
我收到以下錯誤消息。
loading autotest/rspec2
/Users/toad/.autotest:1:in `require': no such file to load -- autotest/growl (LoadError)
from /Users/toad/.autotest:1
from /Library/Ruby/Gems/1.8/gems/ZenTest-4.5.0/lib/autotest.rb:311:in `load'
from /Library/Ruby/Gems/1.8/gems/ZenTest-4.5.0/lib/autotest.rb:311:in `initialize'
from /Library/Ruby/Gems/1.8/gems/ZenTest-4.5.0/lib/autotest.rb:310:in `each'
from /Library/Ruby/Gems/1.8/gems/ZenTest-4.5.0/lib/autotest.rb:310:in `initialize'
from /Library/Ruby/Gems/1.8/gems/rspec-core-2.5.2/lib/autotest/rspec2.rb:11:in `initialize'
from /Library/Ruby/Gems/1.8/gems/ZenTest-4.5.0/lib/autotest.rb:241:in `new'
from /Library/Ruby/Gems/1.8/gems/ZenTest-4.5.0/lib/autotest.rb:241:in `run'
from /Library/Ruby/Gems/1.8/gems/ZenTest-4.5.0/bin/autotest:6
from /usr/bin/autotest:19:in `load'
from /usr/bin/autotest:19
我在想什麼?