簡體   English   中英

使用 rvm ruby​​ 版本獲取錯誤

[英]Getting bug with rvm ruby versions

運行rails c時出現以下錯誤:

Your Ruby version is 2.1.2, but your Gemfile specified 2.2.2

當我運行$rvm list rubies ,我得到以下信息:

rvm rubies
=* ruby-2.2.2 [ x86_64 ]

我很迷惑。 我嘗試將 Gemfile 中的 Ruby 版本更改為 2.1.2 並安裝 ruby​​-2.1.2。 但是我仍然得到:

Your Ruby version is 2.2.2, but your Gemfile specified 2.1.2

有什么建議?

請在您的系統上安裝 ruby​​-2.2.2,然后執行以下任一操作:

1. rvm use ruby-2.2.2
2. create a .ruby-version file inside your application root folder with the following content:
   2.2.2

嘗試這個:

$ rm Gemfile.lock
$ bundle

兩個答案都不適合我,我已經安裝了 2.2.2 並在 .ruby-version 中指定。 對我有用的是

rvm use 2.1.2
rvm use 2.2.2

然后一切正常。 我懷疑 rvm 不知何故混淆了。

聲明:實際上,我在 2.5.9 和 2.7.3 之間交換時遇到了這個問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM