Problem installing gems - ruby

Why do I get this error every time I type gem install gem_name?
ERROR: While executing gem ... (Gem::RemoteSourceException)
HTTP Response 302 fetching http://gems.rubyforge.org/yaml
gem -v = 1.0.1, ruby -v = 1.8.6

gem 1.0.1 is very old, you should update it first.
Probably
gem --update system
is also broken, so you should install a new version manually.
And this is probably the same question.

Related

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.
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
I have added an older version of nokogiri (1.5.11) to chef cookbook and it worked fine after OR manually add it on the server:
chef_gem "nokogiri" do
action :install
version "1.5.11"
compile_time false if respond_to?(:compile_time)
end
OR
/usr/local/ruby-1.9.3-p392/bin/gem install nokogiri --version=1.5.11
(use absolute path where u see the error; means /my_path/gem install nokogiri).

Error running the gem install update

I have installed Instant Rails 2.0. While trying to upgrade RubyGems I run the command gem install update. It fails giving following error.
C:\Users\Owner\Downloads\InstantRails-2.0-win\rails_apps>gem install update
ERROR: While executing gem ... (Gem::RemoteSourceException)
HTTP Response 302 fetching http://gems.rubyforge.org/yaml
Also it is giving same error while executing gem update -- system. or any other gem command.
Try to install a more recent gem version from http://gems.rubyforge.org/

Gem::RemoteSourceException with rubygems 0.9.0

This Perl expert likes ruby OK, but I'm having trouble with a legacy ruby environment I have to maintain.
One host I am maintaining has rubygems 0.9.0, and I can't get it to access a remote repository for an upgrade:
$ gem list --remote --source 'http://rubygems.org/'
*** REMOTE GEMS ***
ERROR: While executing gem ... (Gem::RemoteSourceException)
HTTP Response 302
Apparently this old version can't follow a redirect, and doesn't tell me where it wants to redirect.
Can someone supply:
The correct source repository?
or
How to manually get a newer version of rubygems installed?
From http://rubygems.org/pages/download:
gem install rubygems-update
update_rubygems

Can't install gemcutter as a Ruby Gem source

I'm trying to install the thinking sphinx gem, which is on gemcutter.org
When I run the command
gem sources -a http://gemcutter.org
I get the error:
Error fetching http://gemcutter.org:
bad response Not Found 404 (http://gemcutter.org/specs.4.8)
If I change the above URL to http://gemcutter.org.specs.4.8.gz it finds a file. How do I tell rubygems to download with the .gz extension?
It looks like a temporary Gemcutter failure. It works fine to me.
Make sure you are running the latest RubyGems version and install the latest gemcutter gem.
$ gem install gemcutter --source http://gemcutter.org
With the gemcutter GEM you type gem tumble to add Gemcutter as source.
$ gem tumble
EDIT. I just noticed you are using a really outdated RubyGems version.
Update RubyGems first.
$ gem update --system
If it tells you there's nothing to update, you have a buggy version (RubyGems 1.2 selfupdate was buggy). Upgrade with the following command.
$ gem install rubygems-update
$ update_rubygems
Then add the source.
What version of Rubygems are you running (gem --version)? If less than 1.3.5, you may want to update Rubygems and try again. (gem update --system)
This is working for me with the following sources defined:
http://gems.rubyforge.org/
http://gems.github.com
as I said this is working for me:
gem install thinking-sphinx \
> --source http://gemcutter.org
If you're upgrading, you should read this:
http://freelancing-god.github.com/ts/en/upgrading.html
Successfully installed thinking-sphinx-1.3.2
Successfully installed activesupport-2.3.4
2 gems installed
Installing ri documentation for thinking-sphinx-1.3.2...
Installing ri documentation for activesupport-2.3.4...

RubyGems refuses to update from 1.3.1 to 1.3.5

I can't update the rubygems from 1.3.1 to 1.3.5. I've tried the following commands with no luck(logged in as the root)
gem update --system
gem update rubygems
gem update rubygems -v 1.3.5
gem install rubygems-update -v 1.3.5
The response for the first three command is
Updating RubyGems
Nothing to update
while for the last one the response is
ERROR: could not find gem rubygems-update locally or in a repository
Also the current rubygem fails to install some required gems such as 'geokit'. Could the problems be related?
Current Ruby version 1.8.5 on CentOS 5.0
This might sound silly but do you have gems.rubyforge.org in your remote sources?

Resources