I haven't used Ruby for a while on my Mac. Obviously something has changed in my environment as gem is no longer working as it should.
Some info from my machine, running OSX 10.5.8:
% gem --version
0.9.0
% gem env
Rubygems Environment:
- VERSION: 0.9.0 (0.9.0)
- INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.8
- GEM PATH:
- /usr/local/lib/ruby/gems/1.8
- REMOTE SOURCES:
- http://gems.rubyforge.org
The error I'm seeing is:
% sudo gem update --system
Password:
Updating RubyGems...
Attempting remote update of rubygems-update
ERROR: While executing gem ... (RuntimeError)
rubygems-update requires builder >= 0
Or if I try to install a new gem:
% sudo gem install bossman
ERROR: While executing gem ... (Gem::GemNotFoundException)
Could not find bossman (> 0) in the repository
Some people have recommended clearing out the source_cache file, but this didn't help me. Others recommended:
% gem clean
Cleaning up installed gems...
Clean Up Complete
But that also doesn't help.
Can someone please help me get gem working again? Any insight into the reasoning behind this would be helpful. I know sufficiently little about Ruby and gem to find these error messages cryptic.
EDIT
I tried Derick Bailey's suggestion, but without any luck:
% sudo gem install rubygems-update update_rubygems
Password:
ERROR: While executing gem ... (RuntimeError)
rubygems-update requires builder >= 0
your version of rubygems should support updating, but it's obviously not working. I've been seeing this a lot recently - not just on osx, either.
the "easy" answer is to either re-install your ruby runtime with an updated version of rubygems already packaged with it, or you can install an updated version of rubygems.
for complete instructions on installing rubygems, see http://docs.rubygems.org/read/chapter/3
try running this: gem install rubygems-update update_rubygems
if that doesn't work, you'll need to manually update, which can be done with these instructions: http://docs.rubygems.org/read/chapter/3#page13
Ugh, I thought I had fixed these legacy indexes so update_rubygems worked...I guess not. The main problem here is your version of RubyGems is very old, and you'll need to update. Since you can't install gems, (none are listed in the legacy index, in an effort to get you to update) the best thing to do would be to download the .tgz/.zip from http://gemcutter.org/pages/download and run sudo ruby setup.rb.
Related
I want to build passenger-3.0.19 apache2 module on a debian squeeze server. After calling passenger-install-apache2-module as root i get the following error message:
Compiling and installing Apache 2 module...
cd /usr/lib/ruby/gems/1.8/gems/passenger-3.0.19
/usr/bin/ruby1.8 /usr/bin/rake apache2:clean apache2 RELEASE=yes
# /usr/bin/ruby1.8 /usr/bin/rake apache2:clean apache2 RELEASE=yes
rake aborted!
no such file to load -- rubygems/builder
Where is the problem? How can i fix this? Using passenger-install-apache2-module --trace doesn't work (for full stacktrace).
I used the newest passenger version (actually 4.0.0.rc4) from git repository and created a gem. Using this gem worked fine.
git clone https://github.com/FooBarWidget/passenger.git
cd passenger
gem build passenger.gemspec
gem install passenger-*.gem
After that you can build the apache2 plugin using passenger-install-apache2-module.
I had a similar environment (passenger 3.0.9, Ruby 1.8.7) and i solved the problem by downgrading rubygems.
The latest stable RVM will install rubygems v(2+). I downgraded to rubygems v(1.6.2), reinstalled the passenger gem and the problem went away.
in an RVM environment the command is gem update --system 1.6.2
The 1.8.x version of rubygems also works, but it throws too many deprecation warnings on everything you do.
I answered a similar question a few minutes ago, here: Passenger: cannot load such file rubygems/builder
Essentially is an issue with Ruby 2.0. I offer a possible solutions there (extracted from a github comment).
If you're not using Ruby 2.0 then perhaps you need to do: gem install builder
If you are running Ruby 2
Edit the file config/rubber/rubber-passenger.yml and
Change the line
passenger_version: 3.0.19
To
passenger_version: 4.0.35 # works fine with 4.0.35 but you can try a newer version
Remember to check the Ruby version in
config/rubber/rubber-ruby.yml
ruby_version: 2.0.0-p247
Make sure you got zlibc.
sudo apt-get install zlibc zlib1g zlib1g-dev
then reinstall or recompile ruby.
Had exactly the same problem. On Amazon Linux, following worked fine:
gem install passenger && passenger-install-apache2-module
Running 'gem install passenger' added the latest version to the system. Removed the old one too:
#gem list passenger
*** LOCAL GEMS ***
passenger (4.0.10, 3.0.19)
#gem uninstall passenger
Select gem to uninstall:
1. passenger-3.0.19
2. passenger-4.0.10
3. All versions
> 1
Successfully uninstalled passenger-3.0.19
I had the same issue. To resolve this I had to downgrade rubygems package. My configuration was passenger 3.0.2 and rubygems 1.3.7.
I pushed a gem up to rubygems.org, and when I do a 'gem install (gem)' I get this error:
ERROR: While executing gem ... (NameError)
uninitialized constant Psych::Syck
I can do a 'gem build (gem).gemspec' to generate a local gem and then gem install (gem).gem and that installs fine. I can also put the gem into my Rails' app's Gemfile with a pointer to the Github repo and that will also work. I have tried installing the gem (from rubygems.org on multiple computers and they all get the same error.
I am out of ideas as to what can be causing the install to fail when done from rubygems.org but not when I generate it locally. I am using Jeweler to push the gem up to rubygems.org.
The specific error I got was: uninitialized constant Psych::Syck (NameError) when doing bundle install.
This happened when installing simplecov (awesome code coverage tool) version 0.5.0. Working in Ubuntu 11.04 and using RVM.
Fixed the issue with gem update --system
This updates rubygems and produced the following output:
Updating rubygems-update
Fetching: rubygems-update-1.8.10.gem (100%)
Successfully installed rubygems-update-1.8.10
Installing RubyGems 1.8.10
RubyGems 1.8.10 installed
== 1.8.10 / 2011-08-25
RubyGems 1.8.10 contains a security fix that prevents malicious gems from
executing code when their specification is loaded. See
https://github.com/rubygems/rubygems/pull/165 for details.
* 5 bug fixes:
* RubyGems escapes strings in ruby-format specs using #dump instead of #to_s
and %q to prevent code injection. Issue #165 by Postmodern
* RubyGems attempt to activate the psych gem now to obtain bugfixes from
psych.
* Gem.dir has been restored to the front of Gem.path. Fixes remaining
problem with Issue #115
* Fixed Syck DefaultKey infecting ruby-format specifications.
* `gem uninstall a b` no longer stops if gem "a" is not installed.
------------------------------------------------------------------------------
RubyGems installed the following executables:
/home/baller/.rvm/rubies/ruby-1.9.2-p180/bin/gem
RubyGems system software updated
Seems to be a problem with Syck. See here:
Rails 3.1 on Ubuntu 11.04 via RVM - uninitialized constant Psych::Syck
Here:
http://rubyforge.org/tracker/?group_id=126&atid=575&func=detail&aid=29163
And fixes suggested here:
https://github.com/rubygems/rubygems/pull/57
The solution would be to run the below command in your terminal:
gem update --system
It is a bug in the system gem version that causes this issue. This worked for me.
I had rubygems 1.3.5 (or 1.3.6?) installed and then made a sudo gem update after a long while again. Some gems complained they needed a newer gems version. Because sudo gem update --system is deactivated on Ubuntu I followed these steps: How can I get RubyGems 1.3.6 on Ubuntu 10.4
But now I cannot start the dev_appserver.rb anymore, it says:
=> Bundling gems
ERROR: While executing gem ... (RuntimeError)
Unknown command bundle
I also tried to do sudo gem update and sudo gem update --system again a few times but everything is up-to-date now. Here is a list of my gems: http://pastebin.com/cFaTCyF5
It's a bit of a hack around but I can't really tell what's going on properly from what you sent but I know a few people have been having problems after running gem update --system lately. Find out what version you've just installed with
gem list
Look for the update, should look something like this: rubygems-update-1.5.0
Then try rolling back your rubygems version
sudo gem uninstall rubygems-update -v 1.5.0
sudo gem install rubygems-update -v 1.4.2 <-- try a different version
gem install --system 1.3.7 worked in my case
Trying to install the 'less' gem. I type sudo gem install less as instructed at http://lesscss.org/, and I get the following error:
ERROR: While executing gem ... (Gem::GemNotFoundException)
Could not find less (> 0) in any repository
Alright, so I figure maybe I just need to update RubyGems. Trying 'gem update --system' gets me
Updating RubyGems...
Attempting remote update of rubygems-update
ERROR: While executing gem ... (Gem::InstallError)
rubygems-update requires builder >= 0
Arrgh. Alright, then let's try 'sudo gem install builder':
ERROR: While executing gem ... (Gem::GemNotFoundException)
Could not find builder (> 0) in any repository
Seems that no matter what gem I try to install, it can't be found in any repository. I check my environment, and rubyforge is listed:
RubyGems Environment:
- VERSION: 0.9.4 (0.9.4)
- INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.8
- GEM PATH:
- /usr/local/lib/ruby/gems/1.8
- REMOTE SOURCES:
- http://gems.rubyforge.org
Any idea what's going on? I'm on OSX 10.4, and I installed Ruby 1.8.6 before this.
I think rubygems 1.3.x requires ruby 1.8.7 so you might install that first. Then update rubygems to 1.3.7. via gem update --system
The version of rubygems bundled in osx uses gemforge as its offical source of gems - this has since been replaced with gemcutter. You should be able to do
sudo gem update --system
To upgrade to update the latest version of ruby gems, which will then use gemcutter as the sources link
That's a really old version of rubygems! How did you install this?
Is it a manual install? If so, perhaps you could try a manual upgrade the same way.
Do the following:
sudo gem update --system
to update your install of RubyGems. Then, add the Github gem repository to your sources. I suggest github because you'll find a lot of useful things there:
sudo gem sources -a http://gems.github.com
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...