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.
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 tried to install the package "capistrano" on a linux box but got the following error:
*** buffer overflow detected ***: /usr/bin/ruby terminated
Additionally it showed me a list of the memory map and then the install process was aborted.
Any idea on what causes this error?
Cheers
Roland
I had similar issue when installing Capistrano on CentOs 6.7, Ruby 1.8.5, gem 1.3.1. Turns out the issue was caused by newest highline package.
The following allowed me to install capistrano correctly:
gem install highline --version "=1.6.2"
gem install capistrano --version "=2.6.0"
This error may be related to some Ruby 1.8.6 bugs (see this post http://opsrealism.tumblr.com/post/4931621276/mirroring-rubygems-and-ruby-9-2-on-centos-5-5 for some more details), so you may try to upgrade your Ruby to 1.8.7, if it's possible.
Another option is to try to install a bit older version of gem - it worked for me on a couple of occasions, where exact gem versions didn't matter. For example,
gem install capistrano --version "=2.7.0"
might work.
I'm running:
Centos 5.5
Ruby 1.8.5
Gems 1.3.1
I narrowed the problem down to the highline gem. Although I attempted to intall all of its dependencies manually (which worked), it still failed to load itself unless I followed the above advice and specified the version, 1.6.2. =(
gem install highline --version "=1.6.2"
Hopefully, I'll be migrating off of this ancient OS soon.
I had similar issues installing cap for CentOS 5.8 but it worked using the rvm installer (to upgrade to latest ruby, I used 1.9.2p320 (2012-04-20 revision 35421) [x86_64-linux])
What I d
I yum remove ruby (to get rid of 1.8.x)
I followed simple instructions at https://rvm.io/rvm/install/ for installing rvm
gem install capistrano
cap command is found!
Hope this helps someones
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 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.
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...