I'm having a devil of a time installing Nokogiri on Ubuntu 12.04. I use rbenv.
$ gem install nokogiri -v '1.6.1'
ERROR: While executing gem ... (Errno::EACCES)
Permission denied - /home/deploy/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/nokogiri-1.6.1/.autotest
$ sudo gem install nokogiri -v '1.6.1'
ERROR: Error installing nokogiri:
nokogiri requires Ruby version >= 1.9.2.
$ rbenv sudo gem install nokogiri -v '1.6.1'
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
/home/deploy/.rbenv/versions/2.0.0-p353/bin/ruby extconf.rb
Gem files will remain installed in /home/deploy/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/nokogiri-1.6.1 for inspection.
Results logged to /home/deploy/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/nokogiri-1.6.1/ext/nokogiri/gem_make.out
$ ruby -v
ruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-linux]
$ sudo ruby -v
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
$ rbenv sudo ruby -v
ruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-linux]
$ echo $PATH
/home/deploy/.rbenv/bin:/home/deploy/.rbenv/bin:/home/deploy/.rbenv/shims:/home/deploy/.rbenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
It seems like I need some way of having sudo ruby -v
give me 2.0.0
. What am I missing?