find_spec_for_exe': can't find gem bundler (>= 0.a) (Gem::GemNotFoundException)

后端 未结 15 1275
伪装坚强ぢ
伪装坚强ぢ 2020-11-29 17:14

I used sudo bundle install and that might be the cause of the issue?

Now I have:

  • gem -v 2.6.14
  • ruby -v
15条回答
  •  再見小時候
    2020-11-29 17:49

    Adding to the many answers, my problem stemmed from wanting to use the docker's ruby as a base, but then using rbenv on top. This screws up a lot of things.

    I fixed it in this case by:

    • The Gemfile.lock version did need updating - changing the "BUNDLED WITH" to the latest version did at one point change the error message, so may have been required
    • in .bash_profile or .bashrc, unsetting the environment variables:
    unset GEM_HOME
    unset BUNDLE_PATH
    

    After that, rbenv worked fine. Not sure how those env vars were getting loaded in the first place...

提交回复
热议问题