ruby - 在任何来源中都找不到 public_suffix-2.0.4

标签 ruby macos rubygems jekyll

当我尝试将 Google Tag Manager Gem 添加到我本地安装的 Jekyll 时,它开始了。

A little background here, I'm using homebrew and rbenv.
My ruby version is 2.4.1 or at least I think it is.

gem 没有安装,之后 Jekyll 开始给我这个消息:

Could not find public_suffix-2.0.4 in any of the sources
Run `bundle install` to install missing gems.

运行“bundle install”后出现此错误:

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:inrequire': dlopen(/usr/local/lib/ruby/gems/2.4.0/gems/psych-2.2.4/lib/psych.bundle, 9): Library not loaded: /usr/local/opt/ruby/lib/libruby.2.4.0.dylib (LoadError) Referenced from: /usr/local/lib/ruby/gems/2.4.0/gems/psych-2.2.4/lib/psych.bundle Reason: image not found - /usr/local/lib/ruby/gems/2.4.0/gems/psych-2.2.4/lib/psych.bundle from /usr/local/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in require' from /usr/local/lib/ruby/gems/2.4.0/gems/psych-2.2.4/lib/psych.rb:8:in' from /usr/local/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in require' from /usr/local/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:inrequire' from /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:inrequire' from /usr/local/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in require' from /usr/local/lib/ruby/site_ruby/2.4.0/rubygems.rb:701:inload_yaml' from /usr/local/lib/ruby/site_ruby/2.4.0/rubygems/config_file.rb:340:in load_file' from /usr/local/lib/ruby/site_ruby/2.4.0/rubygems/config_file.rb:202:ininitialize' from /usr/local/lib/ruby/site_ruby/2.4.0/rubygems/gem_runner.rb:75:in new' from /usr/local/lib/ruby/site_ruby/2.4.0/rubygems/gem_runner.rb:75:indo_configuration' from /usr/local/lib/ruby/site_ruby/2.4.0/rubygems/gem_runner.rb:40:in run' from /usr/local/bin/gem:21:in'

我有提到我正在使用自制软件和 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

我不同意这里的想法,并且肯定需要您的帮助。

谢谢。

最佳答案

运行 bundle update && bundle install 对我有用。

关于ruby - 在任何来源中都找不到 public_suffix-2.0.4,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43889073/

相关文章:

ruby-on-rails-4 - 为什么 Rails 引擎的 gem 名称必须为 "match"模块/命名空间名称?

ruby - 在 Ruby 中解析 JSON(如 XPATH)

ruby - 根据 Ruby 中的字符拆分 URL

macos - 永久允许 Xamarin iOS 应用接受传入连接(Xamarin 测试云代理)

xcode - 如何构建适用于大苏尔和蒙特雷的 DEXT

ruby-on-rails - Ruby on Rails 错误:Uglifier::错误:意外的标记:运算符(<)

ruby - 邮寄 gem : how to set an email to "read"?

ruby - Sinatra 重定向到没有路径的 URI

git - 在 Mac 上,行尾会自动设置为 Windows 行尾,我该如何更改?

ruby - 为什么我尝试更新 cocoapods 时会收到此错误?