2017-10-12 92 views
0

我在Ruby 2.0更新到2.4.2使用RVM,並在安裝期間收到以下錯誤信息使用$ rvm install ruby-2.4.2寶石錯誤2.4.2

Making gemset ruby-2.4.2 pristine - please wait 

'command gem pristine --extensions bigdecimal --version 1.3.0 gem-wrappers --version 1.3.2 io-console --version 0.4.6 json --version 2.0.4 openssl --version 2.0.5 psych --version 2.2.2' failed, you need to fix this gems manually. 
Error running '__rvm_with ruby-2.4.2 gemset_pristine', 
please read /Users/myname/.rvm/log/1507820191_ruby-2.4.2/gemset.pristine-ruby-2.4.2.log 

Making gemset [email protected] pristine - please wait 

'command gem pristine --extensions bigdecimal --version 1.3.0 io-console --version 0.4.6 json --version 2.0.4 openssl --version 2.0.5 psych --version 2.2.2' failed, you need to fix this gems manually. 
Error running '__rvm_with [email protected] gemset_pristine', 
please read /Users/myname/.rvm/log/1507820191_ruby-2.4.2/[email protected] 

我......不很確定這意味着什麼,或者我下一步該做什麼。有什麼想法嗎?我正在運行macOS 10.12.6。

[編輯]:Here's a copy的錯誤日誌。

回答

0

找到了解決的使用BREW在這個RVM GitHub issue這涉及到安裝zlib的引用,然後重新安裝Ruby一邊指着解決那個zlib目錄。正如該主題中的某位人士指出的那樣,這不是必要的。仍然不確定問題出現的原因。

$ brew install zlib 
$ rvm remove 2.4.2 
$ rvm install 2.4.2 —with-zlib-dir=/usr/local/Cellar/zlib/1.2.11 
1

根據RVM文檔,您不要在命令中使用ruby-。
它應該是: $ rvm install 2.4.2
我不確定是否重要或不。 您是否嘗試升級RVM和Homebrew?

[編輯]基於從日誌文件中此信息:

bigdecimal-1.3.0 +gemset_pristine:20> gem pristine --extensions bigdecimal --version 1.3.0 
ERROR: Loading command: pristine (LoadError) 
    cannot load such file -- zlib 
ERROR: While executing gem ... (NoMethodError) 
    undefined method `invoke_with_build_args' for nil:NilClass 
+gemset_pristine:21> _failed+=('bigdecimal --version 1.3.0') 

看起來像zlib的問題。嘗試安裝(或重新安裝)命令行工具。
$ xcode-select --install

有在GitHub上一個非常類似的問題https://github.com/rvm/rvm/issues/4090 它是由運行$ brew doctor

+0

我得到相同的結果運行'$ RVM安裝2.4.2'所以沒關係。另外,運行最新版本的RVM [1.29.3]和Homebrew [1.3.5] – strobodyne

+0

我無法測試,因爲我還在10.11.6你看過錯誤中引用的日誌文件嗎? –

+0

我做了,但錯誤日誌似乎沒有包含終端輸出沒有的任何有用信息。但我不妨看看象形文字。這裏是:https://gist.github.com/gwijthoff/8a3e485537787604ac8d1bd4991ea889 – strobodyne

0

剛過一段時間後需要使用SASS之後才提出這個問題。在此期間,我升級到了El Capitan。所以Ruby是'老'的。

你可以通過運行以下(有一點先前的最新的Ruby版本知識)來減少很多步驟。

xcode-select --install brew install zlib rvm reinstall ruby-<latest_version> --with-zlib-dir=/usr/local/Cellar/zlib/<latest_version>


這是我怎麼了去了。我最終不需要卸載,但是我花了很多錯誤的輪次。

起初,我不得不跑這條線得到的xcode最新:

xcode-select --install

然後安裝zlib

brew install zlib

請記下目錄的zlib安裝在

/usr/local/Cellar/zlib/1.2.11

下次更新nvm

\捲曲-ssl https://get.rvm.io | bash -s stable --ruby

遵循這些步驟讓我到了運行最新版本的ruby 2.4.1的地步。但是zlib與ruby沒有關係。

所以最後一步是將運行重新安裝

rvm reinstall ruby-2.4.1 --with-zlib-dir=/usr/local/Cellar/zlib/1.2.11