我使用 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
請幫助我我做錯了什么。
uj5u.com熱心網友回復:
運行以下命令幫助我選擇正確的 rbenv 本地版本
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
source ~/.bash_profile
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/402917.html
標籤:
