Gem安装问题Mac 10.11.5('没有将nil隐式转换为String')

时间:2016-07-02 14:03:10

标签: ruby macos rvm osx-elcapitan

我试图做gem install jekyll(或github-pages)并且没有工作。

> rvm install current && rvm use current
ruby-2.3.1
Using /Users/willwade/.rvm/gems/ruby-2.3.1
> gem install jekyll
ERROR:  While executing gem ... (TypeError)
no implicit conversion of nil into String

我尝试过不同的版本..例如1.9.3及其类似的输出。例如。

> rvm use 1.9.3
Using /Users/willwade/.rvm/gems/ruby-1.9.3-p551
> gem install github-pages
Fetching: terminal-table-1.6.0.gem (100%)
Successfully installed terminal-table-1.6.0
Fetching: mercenary-0.3.6.gem (100%)
Successfully installed mercenary-0.3.6
Fetching: ffi-1.9.10.gem (100%)
Building native extensions.  This could take a while...
Successfully installed ffi-1.9.10
Fetching: rb-inotify-0.9.7.gem (100%)
Successfully installed rb-inotify-0.9.7
Fetching: rb-fsevent-0.9.7.gem (100%)
Successfully installed rb-fsevent-0.9.7
Fetching: listen-3.0.6.gem (100%)
Successfully installed listen-3.0.6
Fetching: jekyll-watch-1.4.0.gem (100%)
Successfully installed jekyll-watch-1.4.0
Fetching: sass-3.4.22.gem (100%)
Successfully installed sass-3.4.22
Fetching: jekyll-sass-converter-1.3.0.gem (100%)
Successfully installed jekyll-sass-converter-1.3.0
Fetching: rouge-1.10.1.gem (100%)
ERROR:  While executing gem ... (TypeError)
    can't convert nil into String

我还尝试过系统版本,例如与sudo

> sudo gem install jekyll
Fetching: liquid-3.0.6.gem (100%)
Successfully installed liquid-3.0.6
Fetching: kramdown-1.11.1.gem (100%)
ERROR:  While executing gem ... (TypeError)
no implicit conversion of nil into String

(编辑)与2.2.0相同:

> rvm use 2.2.0
Using /Users/willwade/.rvm/gems/ruby-2.2.0
> gem install github-pages
Fetching: terminal-table-1.6.0.gem (100%)
Successfully installed terminal-table-1.6.0
Fetching: mercenary-0.3.6.gem (100%)
Successfully installed mercenary-0.3.6
Fetching: ffi-1.9.10.gem (100%)
Building native extensions.  This could take a while...
Successfully installed ffi-1.9.10
Fetching: rb-inotify-0.9.7.gem (100%)
Successfully installed rb-inotify-0.9.7
Fetching: rb-fsevent-0.9.7.gem (100%)
Successfully installed rb-fsevent-0.9.7
Fetching: listen-3.0.6.gem (100%)
Successfully installed listen-3.0.6
Fetching: jekyll-watch-1.4.0.gem (100%)
Successfully installed jekyll-watch-1.4.0
Fetching: sass-3.4.22.gem (100%)
Successfully installed sass-3.4.22
Fetching: jekyll-sass-converter-1.3.0.gem (100%)
Successfully installed jekyll-sass-converter-1.3.0
Fetching: rouge-1.10.1.gem (100%)
ERROR:  While executing gem ... (TypeError)
no implicit conversion of nil into String

关于修复的任何想法?这可能是什么?

2 个答案:

答案 0 :(得分:0)

您可以尝试以下方法之一:

  • 降级为上一个宝石
  • 确保页面没有语法错误
  • 确保配置文件不是空白

希望其中一个有所帮助。

答案 1 :(得分:0)

我不知道是什么导致了头痛......但是这对我来说有用了:

  1. 重新启动mac。
  2. Command + R
  3. 打开终端。输入csrutil disable
  4. 重新启动
  5. gem install jekyll或sudo ..(即使用系统ruby)
  6. 重复步骤1和2 - 并输入csrutil enable
  7. 基本上,El Capitan和Ruby存在SIP问题。请参阅https://apple.stackexchange.com/questions/208478/how-do-i-disable-system-integrity-protection-sip-aka-rootless-on-os-x-10-11