当我尝试将Google跟踪代码管理器Gem添加到我当地的Jekyll安装时,就开始了。
这里有一点背景,我使用自制软件和rbenv 我的ruby版本是2.4.1或至少我认为是。
宝石没有安装,之后杰基尔开始给我这个消息:
Could not find public_suffix-2.0.4 in any of the sources
Run `bundle install` to install missing gems.
运行'捆绑安装'我收到这个错误:
Rubygems 2.0.14.1 is not threadsafe, so your gems will be installed one at a time. Upgrade to Rubygems 2.1.0 or higher to enable parallel gem installation.
Using public_suffix 2.0.4
Using colorator 1.1.0
Using ffi 1.9.14
Using forwardable-extended 2.6.0
Using sass 3.4.22
Using rb-fsevent 0.9.8
Using kramdown 1.12.0
Using liquid 3.0.6
Using mercenary 0.3.6
Using rouge 1.11.1
Using safe_yaml 1.0.4
Using bundler 1.14.6
Using addressable 2.5.0
Using rb-inotify 0.9.7
Using pathutil 0.14.0
Using jekyll-sass-converter 1.4.0
Using listen 3.0.8
Using jekyll-watch 1.5.0
Using jekyll 3.3.0
Using jekyll-feed 0.8.0
Bundle complete! 2 Gemfile dependencies, 20 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
所以我尝试更新Rubygems。傻我。
此消息显示在终端:
/usr/local/Cellar/ruby/2.4.1_1/lib/ruby/2.4.0/yaml.rb:5:in
<top (required)>': It seems your ruby installation is missing psych (for YAML output). To eliminate this warning, please install libyaml and reinstall your ruby. /usr/local/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in
要求&#39;:dlopen(/ usr / local / lib / ruby / gems / 2.4.0 / gems / psych-2.2.4 / lib / psych.bundle,9):未加载库:/usr/local/opt/ruby/lib/libruby.2.4.0.dylib(LoadError) 参考自:/usr/local/lib/ruby/gems/2.4.0/gems/psych-2.2.4/lib/psych.bundle 原因:找不到图像 - /usr/local/lib/ruby/gems/2.4.0/gems/psych-2.2.4/lib/psych.bundle 来自/usr/local/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:inrequire' from /usr/local/lib/ruby/gems/2.4.0/gems/psych-2.2.4/lib/psych.rb:8:in
&#39; 来自/usr/local/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:inrequire' from /usr/local/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in
要求&#39; 来自/usr/local/Cellar/ruby/2.4.1_1/lib/ruby/2.4.0/yaml.rb:6:in<top (required)>' from /usr/local/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in
要求&#39; 来自/usr/local/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:inrequire' from /usr/local/lib/ruby/site_ruby/2.4.0/rubygems.rb:701:in
load_yaml&#39; 来自/usr/local/lib/ruby/site_ruby/2.4.0/rubygems/config_file.rb:340:inload_file' from /usr/local/lib/ruby/site_ruby/2.4.0/rubygems/config_file.rb:202:in
初始化&#39; 来自/usr/local/lib/ruby/site_ruby/2.4.0/rubygems/gem_runner.rb:75:innew' from /usr/local/lib/ruby/site_ruby/2.4.0/rubygems/gem_runner.rb:75:in
do_configuration&#39; 来自/usr/local/lib/ruby/site_ruby/2.4.0/rubygems/gem_runner.rb:40:inrun' from /usr/local/bin/gem:21:in
&#39;
我是否提到我使用自制软件和rbenv?确定。
今天早上我重新安装了Ruby(使用Homebrew)并告诉rbenv使用该版本。
所以我认为我的路径可能是问题,但我怀疑,因为这是我的路径文件的内容:
/Users/bgomes/.nvm/versions/node/v6.10.2/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin
这是.bash_profile的内容:
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile
test -e "${HOME}/.iterm2_shell_integration.bash" && source "${HOME}/.iterm2_shell_integration.bash"
export export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
source ~/.nvm/nvm.sh
这是.bashrc的内容:
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
source ~/.nvm/nvm.sh
我想知道这里的想法是否真的可以帮助你。
感谢。
答案 0 :(得分:3)
是的,所以解决我的问题就是抛弃自制的ruby安装,删除它的符号链接,然后安装rvm并通过rvm安装ruby。
花了我3个小时才找到这个解决方案。
¯\ _(ツ)_ /¯
答案 1 :(得分:1)
运行捆绑包更新和&捆绑包安装对我有用