Rvm and gems, bundle show and gem list

社会主义新天地 提交于 2019-12-01 18:33:29

this happens when you use bundle install --deployment or bundle install --path=..., it generates .bundle/config with something like this:

---
BUNDLE_FROZEN: '1'
BUNDLE_PATH: vendor/bundle
BUNDLE_DISABLE_SHARED_GEMS: '1'

it could be done by one of you coworkers or the bundler/capistrano integration:

  1. if it was your coworker then just remove and ignore it:

    rm -rf .bundle
    echo '.bundle' >> .gitignore
    
  2. for capistrano rvm-capistrano describes how to disable it => https://github.com/wayneeseguin/rvm-capistrano#disabling-bundle---deployment-when-using-gemsets

before doing gem list make sure you use the application's gemset:

rvm use application_ruby@application_gemset
gem list

Be sure to replace application_ruby with your ruby version string and application_gemset to the gemset that is used by your rails application

There is a hidden directory called .bundle in the root of your directory. Remove that, then run bundle again.

According to bundler documentation the current default, in ops case, may have been set to vendor/bundle, e.g. by a prior execution bundle install --path vendor/bundle:

Further bundle commands or calls to Bundler.setup or Bundler.require will remember this location

Also check contents of $BUNDLE_PATH which shows where it's installed. Note: It's also possible it was installed to vendor/bundle via the --deployment option. See Deplyment mode 3.

As answered here, gem list will show only the gems installed using the --system option (see accepted answer and Caspar comment); use bundle list instead, to show gems installed in the application directory, i.e. via bundle install (without the --system option).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!