0

我刚刚安装了 roo gem,当我尝试运行 ruby​​ 脚本时,出现以下错误:

/usr/local/Cellar/ruby/1.9.3-p125/lib/ruby/1.9.1/rubygems/specification.rb:1615:in `raise_if_conflicts': Unable to activate google_drive-0.3.0, because nokogiri-1.5.2 conflicts with nokogiri (!= 1.5.1, != 1.5.2, >= 1.4.4) (Gem::LoadError)
    from /usr/local/Cellar/ruby/1.9.3-p125/lib/ruby/1.9.1/rubygems/specification.rb:738:in `activate'
    from /usr/local/Cellar/ruby/1.9.3-p125/lib/ruby/1.9.1/rubygems/specification.rb:764:in `block in activate_dependencies'
    from /usr/local/Cellar/ruby/1.9.3-p125/lib/ruby/1.9.1/rubygems/specification.rb:758:in `each'
    from /usr/local/Cellar/ruby/1.9.3-p125/lib/ruby/1.9.1/rubygems/specification.rb:758:in `activate_dependencies'
    from /usr/local/Cellar/ruby/1.9.3-p125/lib/ruby/1.9.1/rubygems/specification.rb:742:in `activate'
    from /usr/local/Cellar/ruby/1.9.3-p125/lib/ruby/1.9.1/rubygems/specification.rb:764:in `block in activate_dependencies'
    from /usr/local/Cellar/ruby/1.9.3-p125/lib/ruby/1.9.1/rubygems/specification.rb:758:in `each'
    from /usr/local/Cellar/ruby/1.9.3-p125/lib/ruby/1.9.1/rubygems/specification.rb:758:in `activate_dependencies'
    from /usr/local/Cellar/ruby/1.9.3-p125/lib/ruby/1.9.1/rubygems/specification.rb:742:in `activate'
    from /usr/local/Cellar/ruby/1.9.3-p125/lib/ruby/1.9.1/rubygems.rb:209:in `rescue in try_activate'
    from /usr/local/Cellar/ruby/1.9.3-p125/lib/ruby/1.9.1/rubygems.rb:206:in `try_activate'
    from /usr/local/Cellar/ruby/1.9.3-p125/lib/ruby/1.9.1/rubygems/custom_require.rb:58:in `rescue in require'
    from /usr/local/Cellar/ruby/1.9.3-p125/lib/ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
    from Untitled.rb:8:in `<main>'

有谁知道如何解决这个问题?

谢谢

4

2 回答 2

2

显然 google_drive 不支持 nokogiri 1.5.2。我只需要卸载 nokogiri 1.5.2 并重新安装 1.5.0 即可解决错误。

于 2012-05-11T09:13:19.870 回答
2

您的 get 文件的 nokogiri 行应如下所示:

nokogiri, "1.5.0"

然后从命令行运行

bundle install

然后运行

bundle update

然后通过命令行将目录更改为运行脚本的目录并键入

gem uninstall nokogiri

您将收到一个提示,询问您要安装哪个版本。必须卸载 1.5.1 和 1.5.2。如果两者都安装了,则需要运行 gem uninstall nokogiri 两次。

一旦我完成了所有这些,它在 1.9.3-p125 中对我有用。

仅仅通过将我在 bundler 中的 gem 版本设置为 1.5.0并不能正常工作,它还是使用了更新的 nokogiri 版本。

于 2012-05-17T19:45:55.513 回答