没找到黄瓜

时间:2012-06-26 23:41:47

标签: ruby-on-rails ruby cucumber

我正试图第一次运行黄瓜,但我得到以下内容:

    /opt/local/lib/ruby/site_ruby/1.8/rubygems/dependency.rb:247:in `to_specs': Could not find cucumber (>= 0) amongst [actionmailer-3.2.6, actionpack-3.2.6, activemodel-3.2.6, activerecord-3.2.6, activeresource-3.2.6, activesupport-3.2.6, arel-3.0.2, builder-3.0.0, bundler-1.1.4, coffee-rails-3.2.2, coffee-script-2.2.0, coffee-script-source-1.3.3, diff-lcs-1.1.3, erubis-2.7.0, execjs-1.4.0, hike-1.2.1, i18n-0.6.0, journey-1.0.4, jquery-rails-2.0.2, json-1.7.3, mail-2.4.4, mime-types-1.19, multi_json-1.3.6, polyglot-0.3.3, rack-1.4.1, rack-cache-1.2, rack-ssl-1.3.2, rack-test-0.6.1, rails-3.2.6, railties-3.2.6, rake-0.9.2.2, rdoc-3.12, rspec-2.10.0, rspec-core-2.10.1, rspec-expectations-2.10.0, rspec-mocks-2.10.1, rubygems-bundler-1.0.3, rvm-1.11.3.4, sass-3.1.19, sass-rails-3.2.5, sprockets-2.1.3, sqlite3-1.3.6, thor-0.15.3, tilt-1.3.3, treetop-1.4.10, tzinfo-0.3.33, uglifier-1.2.5] (Gem::LoadError)
    from /opt/local/lib/ruby/site_ruby/1.8/rubygems/dependency.rb:256:in `to_spec'
    from /opt/local/lib/ruby/site_ruby/1.8/rubygems.rb:1182:in `gem'
    from /opt/local/bin/cucumber:18

我实际上使用rvm安装了ruby 1.9.3,当我rvm list时,我得到了

       ruby-1.9.2-p320 [ x86_64 ]
    =* ruby-1.9.3-p194 [ x86_64 ]
    # => - current
    # =* - current && default
    #  * - default

使用sudo gem install cucumber安装黄瓜。

那么,是否有一些黄瓜的配置文件,我需要更改它以指向当前使用的ruby版本?

我刚注意到我的Rails也说我的ruby环境是1.8.7 ......我已经安装了Rails 3.2.6。 在确认rvm说我使用1.9.3后,我肯定创建了Rails应用程序。 也许两者都有关系?

1 个答案:

答案 0 :(得分:2)

很高兴在评论中看到你已经解决了这个问题。但对于面临同样问题的其他开发人员,我发布了这个答案。通过使用sudo安装gem创建问题。这是对install ruby on rails in Ubuntu的良好指导。如果你遇到问题,比如命令找不到'rails'或'cucumber'。那你应该先检查你的路径。以下是that problem

的答案