问题
I have just installed the roo gem and when I try and run a ruby script I get the following errors:
/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>'
Does anyone have any ideas how to resolve the problem?
Thanks
回答1:
Apparently google_drive does not support nokogiri 1.5.2. I just needed to uninstall nokogiri 1.5.2 and reinstall 1.5.0 and it resolved the error.
回答2:
The nokogiri line of your get file should look like this:
nokogiri, "1.5.0"
Then run from command line
bundle install
Then run
bundle update
Then change directory via command line to the directory your script is running in and type
gem uninstall nokogiri
You will get a prompt asking you which version you want to install. 1.5.1 and 1.5.2 must be uninstalled. If both are installed, you'll need to run gem uninstall nokogiri twice.
Once I had done all that, it worked for me in 1.9.3-p125.
It did not work simply by setting my gem version in bundler to 1.5.0, it used the a newer nokogiri version anyway.
来源:https://stackoverflow.com/questions/10539516/google-drive-0-3-0-conflicts-with-nokogiri