2010-12-11 47 views
7

J'ai des problèmes avec rvm, bundler et gemsets. J'ai installé dans 3 rubis RVM:En utilisant RVM, bundler n'installe pas dans gemset approprié lorsque les gemmes sont installées dans une autre version de ruby ​​

rvm rubies 

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

Et gemsets comme ceci:

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 ] 

J'ai un .rvmrc qui passe à ruby ​​1.9.2 et gemset "de Instapaper":

rvm use [email protected] 

Je veux utiliser bundler, donc j'installe manuellement bundler dans ce gemset et cela fonctionne bien.

Je bâtirai mon Gemfile:

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

Puis, quand je lance "paquet install" il utilise les pierres précieuses qu'il voit dans 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 

Si je lance "Info RVM" il crache toutes les bonnes informations et je suis même en mesure d'installer un petit bijou manuellement sans problème:

[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" 

Je ne suis pas sûr pourquoi il s installer ces gemmes à l'extérieur de la gemset.

Mise à jour 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

Pouvez-vous publier la sortie que vous obtenez de ce qui suit: 'rvm use [email protected] && which bundle' – bowsersenior

+0

Yep, il est posté sous" Update 1 " –

Répondre

5

Après avoir parlé avec "indirecte" sur #bundler sur IRC nous avons déterminé que mon BUNDLE_PATH a été fixé à /Users/kold/.rvm/gems/ree-1.8.7-2010.02. Une fois que j'ai fait un unset BUNDLE_PATH tout a fonctionné comme il se doit!

+1

Vous pourriez ping l'auteur de RVM et voir s'il y a un moyen d'avoir bundler "hériter" des paramètres de RVM. Vous pouvez obtenir l'email de Wayne en utilisant 'rvm -v'. –

+3

Voici une autre question connexe avec des détails sur la façon de 'unset BUNDLE_PATH' http://stackoverflow.com/questions/5039938/bundle-install-to-development – Schneems