2013-11-25 22 views
1

希望能夠幫助我解決從使用rvm切換到rbenv後出現的問題。我工作的公司已經開始使用Boxen來管理開發環境,並且這與rvm因此不兼容。切換到rbenv後無法找到寶石

反正我的問題是切換後我的一些寶石沒有找到。例如capybara webkit。我已經將此添加到我的gem文件中,運行捆綁器並且所有gem都按預期安裝。然後,我做了一個ebenv rehash爲新寶石安裝墊片。

然而,當我嘗試運行我的測試中,我得到的錯誤:

no such file to load -- capybara-webkit (LoadError) 

我的寶石名單如下:

Using mime-types (2.0) 
Using mini_portile (0.5.2) 
Using nokogiri (1.6.0) 
Using rack (1.5.2) 
Using rack-test (0.6.2) 
Using xpath (2.0.0) 
Using capybara (2.1.0) 
Using json (1.8.1) 
Using capybara-webkit (1.0.0) 
Using ffi (1.8.1) 
Using childprocess (0.3.9) 
Using cliver (0.2.2) 
Using diff-lcs (1.2.4) 
Using zip (2.0.2) 
Using jar_wrapper (0.1.7) 
Using multi_json (1.7.4) 
Using websocket-driver (0.3.0) 
Using poltergeist (1.4.1) 
Using rspec-core (2.13.1) 
Using rspec-expectations (2.13.0) 
Using rspec-mocks (2.13.0) 
Using rspec (2.13.0) 
Using rubyzip (0.9.9) 
Using selenium (0.2.10) 
Using websocket (1.0.7) 
Using selenium-webdriver (2.32.1) 
Using bundler (1.3.5) 

我的紅寶石寶石的環境是:

RubyGems Environment: 
- RUBYGEMS VERSION: 1.8.23 
- RUBY VERSION: 1.9.3 (2013-06-27 patchlevel 448) [x86_64-darwin12.4.0] 
- INSTALLATION DIRECTORY: /opt/boxen/rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1 
- RUBY EXECUTABLE: /opt/boxen/rbenv/versions/1.9.3-p448/bin/ruby 
- EXECUTABLE DIRECTORY: /opt/boxen/rbenv/versions/1.9.3-p448/bin 
- RUBYGEMS PLATFORMS: 
- ruby 
- x86_64-darwin-12 
- GEM PATHS: 
- /opt/boxen/rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1 
- /Users/Gerry/.gem/ruby/1.9.1 
- /opt/boxen/rbenv/plugins/rbenv-gem-rehash 
- GEM CONFIGURATION: 
    - :update_sources => true 
    - :verbose => true 
    - :benchmark => false 
    - :backtrace => false 
    - :bulk_threshold => 1000 
    - "gem" => "--no-ri --no-rdoc" 
- REMOTE SOURCES: 
    - http://rubygems.org/ 

我相信這個問題可能與我的路徑有關。我使用的zsh並增加在(https://github.com/sstephenson/rbenv

# rbenv 
export PATH="$HOME/.rbenv/bin:$PATH" 
eval "$(rbenv init -)" 

當我運行命令回聲$ PATH我得到以下下面我.zshrc按指令:

的/ opt/Boxen有/ rbenv /墊片:/Users/Gerry/.rbenv/bin:node_modules/.bin文件中:/ opt/Boxen有/ nodenv /墊片中:/ opt/Boxen有/ nodenv /斌:倉中:/ opt/Boxen有/ rbenv /墊片中:/ opt/boxen/rbenv/bin:/ opt/boxen/rbenv/plugins/ruby​​-build/bin:/ opt/boxen/bin:/ opt/boxen/homebrew/bin:/ opt/boxen/homebrew/sbin:/ usr /斌:/ bin中:/ usr/sbin目錄:/ sbin目錄:在/ usr/local/bin目錄:在/ usr/X11/bin中:/Users/Gerry/Sites/EventMobi/Code/ec2-api-tools-1.6.1.3/bin:/usr/local/share/npm/bin

有人知道我做錯了什麼嗎?

+1

你已經運行束切換,對吧? –

+0

嗨邁克 - 是的,自從轉換以來,我一直在跑包。我也嘗試手動安裝寶石。 – user1523236

+0

當你輸入'ruby --version'時,你看到了什麼? –

回答

1

好的,設法讓這個工作。不知道什麼修復程序是我幾次運行rbenv rehash,我不再收到錯誤信息。所有的寶石都按預期發現。

相關問題