我遇到了rvm,bundler和gemsets的问题.我在rvm中安装了3个红宝石:
rvm rubies
macruby-0.7.1 [ x86_64 ]
ree-1.8.7-2010.02 [ x86_64 ]
=> ruby-1.9.2-p0 [ x86_64 ]
Run Code Online (Sandbox Code Playgroud)
和宝石一样:
rvm gemsets
macruby-0.7.1 [ x86_64 ]
ree-1.8.7-2010.02 [ x86_64 ]
ree-1.8.7-2010.02@chef [ x86_64 ]
ree-1.8.7-2010.02@global [ x86_64 ]
ree-1.8.7-2010.02@mobi [ x86_64 ]
ree-1.8.7-2010.02@temple_rails [ x86_64 ]
ruby-1.9.2-p0 [ x86_64 ]
=> ruby-1.9.2-p0@instapaper [ x86_64 ]
ruby-1.9.2-p0@mobi [ x86_64 ]
Run Code Online (Sandbox Code Playgroud)
我有一个.rvmrc切换到ruby 1.9.2和"instapaper"gemset:
rvm use ruby-1.9.2-p0@instapaper
Run Code Online (Sandbox Code Playgroud)
我想使用bundler,所以我在这个gemset中手动安装bundler,这很好用.
我构建我的Gemfile:
source "http://rubygems.org"
gem "mechanize"
gem "highline"
gem "www-delicious"
Run Code Online (Sandbox Code Playgroud)
然后,当我运行"bundle install"时,它使用它在ree 1.8.7中看到的gem:
Using highline (1.6.1)
Using nokogiri (1.4.4) …Run Code Online (Sandbox Code Playgroud)