【发布时间】:2022-12-21 14:54:24
【问题描述】:
在我的本地机器上,我使用的是rbenv
当我运行bundle install时,我得到:
The git source `git://github.com/sinatra/sinatra.git` uses the `git` protocol, which transmits data without encryption. Disable this warning with `bundle config git.allow_insecure true`, or switch to the `https` protocol to keep your data secure.
Warning: the running version of Bundler (1.17.2) is older than the version that created the lockfile (1.17.3). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
Following files may not be writable, so sudo is needed:
/Library/Ruby/Gems/2.6.0
/Library/Ruby/Gems/2.6.0/build_info
/Library/Ruby/Gems/2.6.0/cache
/Library/Ruby/Gems/2.6.0/doc
/Library/Ruby/Gems/2.6.0/extensions
/Library/Ruby/Gems/2.6.0/gems
/Library/Ruby/Gems/2.6.0/specifications
Your Ruby version is 2.6.8, but your Gemfile specified 2.5.5
问题是,当我运行 rbenv 版本时,我得到了正确的版本 (2.5.5):
system
* 2.5.5 (set by /Users/Mahmoud/dev-reps/non-docker/normal/.ruby-version)
当我运行which ruby时,它正确地指向了 rbenv:
/Users/Mahmoud/.rbenv/shims/ruby
甚至 ruby -v 也给出了正确的版本:
ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-darwin21]
所以大概,2.5.5 是我拥有的唯一版本。 除此之外,我尝试了所有与捆绑器相关的常用技巧:
bundle uninstall, gem uninstall bundler -v 1.17.2
但似乎没有任何效果。
我认为另一个“有趣”的事实给出了提示:which bundle 给出:
/usr/local/bin/bundle
我的问题是这个 2.6.8 来自哪里?我该如何解决这个问题并启动服务器?
【问题讨论】:
-
您的项目工作区中是否有版本文件?
-
如果这就是您所说的,我有一个 VERSION.json 文件
-
这可能与您的宝石集有关。 rbenv gemset list 给你什么?另外,我可以推荐使用 rvm 而不是 rbenv,如果使用 rvm 会简单得多,我只需切换
rvm use 2.5.5就可以解决问题,但等效的 rbenv 解决方案是rbenv local 2.5.5我相信,也许您正在使用项目 gemset 但我不要 rbenv 如何处理那些
标签: ruby-on-rails ruby bundle bundler rbenv