2010-12-11 112 views
7

我遇到rvm,bundler和gemsets問題。我已經安裝在RVM 3個紅寶石:使用RVM時,當gem安裝在不同的ruby版本中時,bundler不會安裝在適當的gemset中

rvm rubies 

    macruby-0.7.1 [ x86_64 ] 
    ree-1.8.7-2010.02 [ x86_64 ] 
=> ruby-1.9.2-p0 [ x86_64 ] 

而且gemsets像這樣:

rvm gemsets 

    macruby-0.7.1 [ x86_64 ] 
    ree-1.8.7-2010.02 [ x86_64 ] 
    [email protected] [ x86_64 ] 
    [email protected] [ x86_64 ] 
    [email protected] [ x86_64 ] 
    [email protected]_rails [ x86_64 ] 
    ruby-1.9.2-p0 [ x86_64 ] 
=> [email protected] [ x86_64 ] 
    [email protected] [ x86_64 ] 

我有一個開關紅寶石1.9.2一個.rvmrc和 「Instapaper的」 寶石:

rvm use [email protected] 

我想使用捆綁器,所以我手動安裝捆綁器在這個gemset和工作正常。

我建立我的Gemfile:

source "http://rubygems.org" 
gem "mechanize" 
gem "highline" 
gem "www-delicious" 

然後當我運行 「包安裝」,它使用它看到的寶石在REE 1.8.7:

Using highline (1.6.1) 
Using nokogiri (1.4.4) 
Using mechanize (1.0.0) 
Using www-delicious (0.4.0) 
Using bundler (1.0.7) 
Your bundle is complete! It was installed into /Users/kold/.rvm/gems/ree-1.8.7-2010.02 

如果我跑 「RVM信息」它吐出所有正確的信息,我甚至可以安裝寶石手動沒有問題:

[email protected] [master*]$ rvm info 

[email protected]: 

    system: 
    uname:  "Darwin Kevin-Olds-MacBook-Pro.local 10.4.0 Darwin Kernel Version 10.4.0: Fri Apr 23 18:28:53 PDT 2010; root:xnu-1504.7.4~1/RELEASE_I386 i386 i386" 
    bash:  "/bin/bash => GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin10.0)" 
    zsh:   "/bin/zsh => zsh 4.3.9 (i386-apple-darwin10.0)" 

    rvm: 
    version:  "rvm 1.1.0 by Wayne E. Seguin ([email protected]) [http://rvm.beginrescueend.com/]" 

    ruby: 
    interpreter: "ruby" 
    version:  "1.9.2p0" 
    date:   "2010-08-18" 
    platform:  "x86_64-darwin10.4.0" 
    patchlevel: "2010-08-18 revision 29036" 
    full_version: "ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.4.0]" 

    homes: 
    gem:   "/Users/kold/.rvm/gems/[email protected]" 
    ruby:   "/Users/kold/.rvm/rubies/ruby-1.9.2-p0" 

    binaries: 
    ruby:   "/Users/kold/.rvm/rubies/ruby-1.9.2-p0/bin/ruby" 
    irb:   "/Users/kold/.rvm/rubies/ruby-1.9.2-p0/bin/irb" 
    gem:   "/Users/kold/.rvm/rubies/ruby-1.9.2-p0/bin/gem" 
    rake:   "/Users/kold/.rvm/rubies/ruby-1.9.2-p0/bin/rake" 

    environment: 
    PATH:   "/Users/kold/.rvm/gems/[email protected]/bin:/Users/kold/.rvm/gems/[email protected]/bin:/Users/kold/.rvm/rubies/ruby-1.9.2-p0/bin:/Users/kold/.rvm/bin:/usr/local/bin:/usr/local/mysql/bin:/opt/local/bin:/Users/kold/bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin" 
    GEM_HOME:  "/Users/kold/.rvm/gems/[email protected]" 
    GEM_PATH:  "/Users/kold/.rvm/gems/[email protected]:/Users/kold/.rvm/gems/[email protected]" 
    MY_RUBY_HOME: "/Users/kold/.rvm/rubies/ruby-1.9.2-p0" 
    IRBRC:  "/Users/kold/.rvm/rubies/ruby-1.9.2-p0/.irbrc" 
    RUBYOPT:  "" 
    gemset:  "instapaper" 

我只是不知道爲什麼它'在寶石外面安裝這些寶石。

更新1:

$ rvm use [email protected] && which bundle 
Using /Users/kold/.rvm/gems/ruby-1.9.2-p0 with gemset instapaper 
/Users/kold/.rvm/gems/[email protected]/bin/bundle 

[email protected] [master*]$ bundle --verbose check 
Using highline (1.6.1) from /Users/kold/.rvm/gems/ree-1.8.7-2010.02/specifications/highline-1.6.1.gemspec 
Using nokogiri (1.4.4) from /Users/kold/.rvm/gems/ree-1.8.7-2010.02/specifications/nokogiri-1.4.4.gemspec 
Using mechanize (1.0.0) from /Users/kold/.rvm/gems/ree-1.8.7-2010.02/specifications/mechanize-1.0.0.gemspec 
Using www-delicious (0.4.0) from /Users/kold/.rvm/gems/ree-1.8.7-2010.02/specifications/www-delicious-0.4.0.gemspec 
Using bundler (1.0.7) from /Users/kold/.rvm/gems/[email protected]/gems/bundler-1.0.7/lib/bundler 
Your bundle is complete! It was installed into /Users/kold/.rvm/gems/ree-1.8.7-2010.02 
+0

你可以發佈你從以下輸出:'rvm use ruby​​[email protected] && which bundles' – bowsersenior 2010-12-11 02:57:37

+0

是的,它張貼在「更新1」 – 2010-12-11 03:09:15

回答

5

在IRC上#bundler與 「間接」 交談後,我們決定了我BUNDLE_PATH設置爲/Users/kold/.rvm/gems/ree-1.8.7-2010.02。一旦我做了一個unset BUNDLE_PATH一切正常,因爲它應該!

+1

你可以ping RVM的作者,看看是否有一種讓捆綁器「繼承」RVM設置的方法。您可以使用'rvm -v'獲得Wayne的電子郵件。 – 2010-12-11 19:45:09

+3

這裏是另一個相關的問題,詳細介紹如何「解除BUNDLE_PATH」http://stackoverflow.com/questions/5039938/bundle-install-to-development – Schneems 2011-09-08 17:48:28

相關問題