捆绑安装后,Gems不在Local Gems中
新机器。 新的rbenv安装。 新的rbenv-gemset安装。 新的ruby-2.0.0安装。 新的rails 4.0.0应用程序。
当我
$ bundle install
从rails app目录,我得到
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
此应用程序中的默认设置是安装到vendor/bundle
。 你可以告诉It was installed into ./vendor/bundle
在gems安装后出现的It was installed into ./vendor/bundle
文本中。
Bundler文档指定您必须将--system
传递给系统位置中的安装:
--system: Install to the system location ($BUNDLE_PATH or $GEM_HOME) even if the bundle was previously installed somewhere else for this application
编辑:更多的解释是,你的ruby只知道在不使用bundle exec
时使用–system选项安装的gem。 您可以通过运行bundle exec gem list
或(如Casper注意到的) bundle list
从vendor/bundle
或您选择的任何路径中查看您的gem。 现在,您可以选择是将系列位置还是应用程序目录中的gem。