【发布时间】:2021-12-31 08:17:16
【问题描述】:
我使用 rbenv 安装了 Ruby。我正在使用 Mac。对于我的一个项目,我使用的是 ruby 2.6.3。对于我的另一个项目,我需要 ruby 2.7.4。所以我安装了这两个版本。
在我的第一个项目中,如果我使用 rbenv 版本,它会正确显示
system
* 2.6.3 (set by /Users/suganyas/academics/project1/.ruby-version)
2.7.4
对于我的第二个项目,我使用命令设置 ruby 版本 2.7.4
rbenv local 2.7.4
因此,如果我从第二个项目中执行 rbenv 版本,它会再次显示,
system
2.6.3
* 2.7.4 (set by /Users/suganyas/project2/ceep/.ruby-version)
但是当我进行捆绑安装时,我收到以下错误
Your Ruby version is 2.6.3, but your Gemfile specified 2.7.4
完整的跟踪在这里
The git source `git://github.com/sqlninja/outdatedbrowser_rails.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.
The git source `git://github.com/nhodges/phantomjs-gem.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.
The git source `git://github.com/heapsource/active_model_otp.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.
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.3, but your Gemfile specified 2.7.4
请帮助我做错了什么。
【问题讨论】:
-
也许this article 可能会有所帮助。
-
您是否也为 Ruby
2.7.4安装了bundler?切换到 Ruby2.7.4然后运行 gem install bundler可能会有所帮助。 -
@spickermann,是的,也安装了捆绑器。还是同样的问题。