Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to install nokogiri using rvm, receiving "nokogiri requires Ruby version >= 1.9.2"

If I try to install nokogiri, I receive the following error:

rvmsudo gem install nokogiri
ERROR:  Error installing nokogiri:
    nokogiri requires Ruby version >= 1.9.2.

If I check my ruby version, it tells me I am running ruby1.9.3

ruby -v
ruby 1.9.3p448 (2013-06-27 revision 41675) [i686-linux]

If I use printenv, these are my env variables:

rvm_bin_path=/home/jenkins/.rvm/bin
GEM_HOME=/home/jenkins/.rvm/gems/ruby-1.9.3-p448@nokogiri
SHELL=/bin/bash
TERM=xterm-color
IRBRC=/home/jenkins/.rvm/rubies/ruby-1.9.3-p448/.irbrc
HUSHLOGIN=FALSE
MY_RUBY_HOME=/home/jenkins/.rvm/rubies/ruby-1.9.3-p448
USER=jenkins
rvm_path=/home/jenkins/.rvm
L1=-
rvm_prefix=/home/jenkins
MAIL=/var/mail/jenkins
PATH=/home/jenkins/.rvm/gems/ruby-1.9.3-p448@nokogiri/bin:/home/jenkins/.rvm/gems/ruby-1.9.3-p448@global/bin:/home/jenkins/.rvm/rubies/ruby-1.9.3-p448/bin:/home/jenkins/.rvm/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
PWD=/home/jenkins
LANG=C
rvm_version=1.21.3 (stable)
SHLVL=1
HOME=/home/jenkins
LOGNAME=jenkins
GEM_PATH=/home/jenkins/.rvm/gems/ruby-1.9.3-p448@nokogiri:/home/jenkins/.rvm/gems/ruby-1.9.3-p448@global
install_flag=1
RUBY_VERSION=ruby-1.9.3-p448
_=/usr/bin/printenv

I have some pretty bad luck with RVM and rather than break my entire installation, I thought I'd ask here.

Why can't I proceed with the installation of nokogiri?

I'm on Debian.

like image 843
harperville Avatar asked Jul 01 '13 13:07

harperville


1 Answers

Just try gem install nokogiri as you have RVM installed. See here Installing Nokogiri for other things to install with it.

Like below :

# nokogiri requirements
sudo apt-get install libxslt-dev libxml2-dev
gem install nokogiri

See my answer here for the part ERROR: While executing gem ... (Errno::EACCES) ` Permission denied

like image 148
Arup Rakshit Avatar answered Sep 19 '22 03:09

Arup Rakshit