簡體   English   中英

捆綁安裝后,Gems不在Local Gems中

[英]Gems not in Local Gems after bundle install

新機器。 新的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

所有安裝的寶石都沒有顯示出來。

我跑了

$ 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 listvendor/bundle或您選擇的任何路徑中查看您的gem。 現在,您可以選擇是在系統位置還是在應用程序目錄中使用寶石。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM