2012-06-26 59 views
0

我試圖爲第1時間運行黃瓜,但我得到以下幾點:黃瓜未發現

/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 

其實我已經有紅寶石1.9.3使用RVM安裝,當我做rvm list ,我得到

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

黃瓜使用sudo gem install cucumber安裝。

那麼,是否有一些黃瓜配置文件,我需要改變它以指向目前使用的紅寶石版本?

我剛剛注意到我的Rails也說我的ruby環境是1.8.7 ...我已經安裝了Rails 3.2.6。 我確定在檢查rvm說我正在使用1.9.3後創建了Rails應用程序。 也許兩者都有關係?

+0

的答案你爲什麼使用sudo來安裝寶石?你是否在全球安裝rvm? –

+0

它發出關於權限的聲音,所以我最終使用了sudo。我如何判斷它是否全局安裝?我使用了https://rvm.io/rvm/install/上推薦的RailsInstaller,並且它詢問我的管理員密碼,所以我猜是的。但不知道如何確認。 –

+2

來檢查你的ruby是否來自rvm做'哪個ruby'。你是否已將所需的行添加到.bashrc文件中?另外,使用bundler來管理寶石。 –

回答