新机器。新的rbenv安装。新的rbenv-gemset安装。新的ruby-2.0.0安装。新的rails 4.0.0应用程序。
当我
$ bundle install从rails应用程序目录中,我得到
Your bundle is complete!
It was installed into ./vendor/bundle但是,如果我那时
$ gem list本应安装的gem都没有显示出来。
我跑过了
$ rbenv rehash为什么会这样呢?
其他信息:
$ which bundle
/usr/local/var/rbenv/shims/bundle
$ rbenv which bundle
/usr/local/var/rbenv/versions/2.0.0-p247/bin/bundle
$ rbenv which ruby
/usr/local/var/rbenv/versions/2.0.0-p247/bin/ruby
$ ruby --version
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.4.0]
$ rbenv gemset active
blog
$ which rails
/usr/local/var/rbenv/shims/rails发布于 2013-07-06 19:23:34
您在此应用程序中的默认设置是安装到vendor/bundle。你可以通过安装gems后出现的It was installed into ./vendor/bundle文本来判断这一点。
Bundler documentation指定您必须传递--system才能在系统位置安装:
--system: Install to the system location ($BUNDLE_PATH or $GEM_HOME) even
if the bundle was previously installed somewhere else for this
application编辑:更多的解释是,当不使用bundle exec时,您的ruby只知道使用--system选项安装的gem。通过运行bundle exec gem list或(正如Casper注意到的) bundle list,您可以从vendor/bundle或您选择的任何路径查看您的gem。现在您可以选择是将gem放在系统位置还是放在应用程序目录中。
https://stackoverflow.com/questions/17502373
复制相似问题