【问题标题】:Install autotest lib not found error安装自动测试库未找到错误
【发布时间】:2023-03-29 21:05:01
【问题描述】:

我无法让自动测试工作。 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

随后我安装了 growl 和 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

我错过了什么?

【问题讨论】:

    标签: ruby-on-rails rspec gem autotest


    【解决方案1】:

    autotest-growlautotest 是一个单独的 gem,因此您需要在 Gemfile 中为其单独输入一个条目:

    gem 'autotest-growl'
    

    您可能还需要一个单独的 Gemfile 条目以用于 autotest-fsevent

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-09-24
      • 2017-10-13
      • 1970-01-01
      • 1970-01-01
      • 2021-02-10
      • 1970-01-01
      相关资源
      最近更新 更多