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

我错过了什么?

4

1 回答 1

1

autotest-growl是一个单独的宝石autotest,所以你需要在你的Gemfile

gem 'autotest-growl'

您可能也需要单独的Gemfile条目autotest-fsevent

于 2011-06-05T03:34:58.037 回答