Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6112367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:44:15+00:00 2026-05-23T14:44:15+00:00

$ gem -v 1.8.5 $ ruby -v ruby 1.8.7 (2010-04-19 patchlevel 253) [x86_64-linux], MBARI

  • 0
$ gem -v
1.8.5
$ ruby -v
ruby 1.8.7 (2010-04-19 patchlevel 253) [x86_64-linux], MBARI 0x6770, Ruby Enterprise Edition 2010.02

$ sudo gem install sanitize
ERROR:  Error installing sanitize:
    nokogiri requires Ruby version >= 1.8.7

This happens for other gems as well, not just nokogiri. I am on Ruby 1.8.7 and have set my $PATH to include /opt/ruby-enterprise-1.8.7-2010.02/bin/ruby before /usr/bin where system Ruby (1.8.6) is installed.

$ gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.5
  - RUBY VERSION: 1.8.7 (2010-04-19 patchlevel 253) [x86_64-linux]
  - INSTALLATION DIRECTORY: /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8
  - RUBY EXECUTABLE: /opt/ruby-enterprise-1.8.7-2010.02/bin/ruby
  - EXECUTABLE DIRECTORY: /opt/ruby-enterprise-1.8.7-2010.02/bin

$ which ruby
/opt/ruby-enterprise-1.8.7-2010.02/bin/ruby
$which gem
/opt/ruby-enterprise-1.8.7-2010.02/bin/gem
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T14:44:15+00:00Added an answer on May 23, 2026 at 2:44 pm

    Your sudo command is most probably changing your PATH variable. Try sudo gem env and you can verify this. As a solution you might try this:

    sudo env PATH=$PATH gem install ...
    

    Also see here for further discussion:
    sudo changes PATH – why?

    As a workaround you could also do:

    sudo su -m
    

    To get to a root prompt using the -m modifier to preserve environment. Then from that root prompt do your gem installs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have ruby 1.9.2 installed: alykhan@helium:~$ ruby -v ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-linux]
meder@dunross:~$ sudo gem install haml Successfully installed haml-3.0.12 1 gem installed Installing ri documentation
I'm on Ubuntu 10.04 x64, ruby version 1.8.7 (2010-01-10 patchlevel 249) I've read this
I tried to install the ruby-hmac gem If I do gem list, I see
After installing Ruby and Ruby Gems: $ sudo apt-get install ruby rubygems ... $
I tried to do install gem sqlite3 with sudo gem install sqlite3 I then
I'm trying to install the ruby gem for curl (curb) on Ubuntu 10.10, but
I'm receiving the following error when trying to install the holidays gem: # gem
> gem env gempath /Users/davec/.gem/ruby/1.8:/opt/local/lib/ruby/gems/1.8 > head Rakefile require 'rubygems' puts Gem.path require 'rake/clean'
Using Your Ruby Gem(s) You will need to add /home/username/ruby/gems to the include path.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.