0

I got stuck in a dead end after trying to install the gem 'thin' on the environment

  RHEL 6.0
  Ruby 1.9.3
  Rails 3.2.8

As indicated, I added

gem 'thin'

to my Gemfile and ran

bundle install

The installation seemed to be successful, but after that, whenever I run 'gem', I get

<internal:prelude>:8:in `lock': ERROR: Failed to build gem native extension. (Gem::Ext::BuildError)

    ERROR: Failed to build gem native extension.

    deadlock; recursive locking

Gem files will remain installed in /usr/local/lib/ruby/gems/1.9.1/gems/eventmachine-1.0.3 for inspection.
Results logged to /usr/local/lib/ruby/gems/1.9.1/extensions/x86_64-linux/1.9.1-static/eventmachine-1.0.3/gem_make.out

While if I run again 'bundle install' I get

Unfortunately, a fatal error has occurred. Please see the Bundler troubleshooting documentation at
http://bit.ly/bundler-issues. Thanks!
<internal:prelude>:8:in `lock': ERROR: Failed to build gem native extension. (Gem::Ext::BuildError)

    ERROR: Failed to build gem native extension.

    deadlock; recursive locking

Gem files will remain installed in /usr/local/lib/ruby/gems/1.9.1/gems/eventmachine-1.0.3 for inspection.
Results logged to /usr/local/lib/ruby/gems/1.9.1/extensions/x86_64-linux/1.9.1-static/eventmachine-1.0.3/gem_make.out

I even tried to follow troubleshooting at https://github.com/bundler/bundler/blob/master/ISSUES.md but nothing has changed.

Looks like there's something corrupted in the eventmachine gem installation, but I can't neither uninstall or reinstall it.

Has anybody got an idea?

I would like at least to be able to revert to the (working) configuration prior to thin installation....

zeroquaranta
  • 392
  • 4
  • 16
  • Try `rm -rf /usr/local/lib/ruby/gems/1.9.1/gems/eventmachine-1.0.3`, then `rm -rf /usr/local/lib/ruby/gems/1.9.1/extensions/x86_64-linux/1.9.1-static/eventmachine-1.0.3`, then `gem pristine eventmachine` – Unixmonkey Jun 27 '14 at 13:02
  • still no luck `/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/ext/builder.rb:160:in chdir': ERROR: Failed to build gem native extension. (Gem::Ext::BuildError) No such file or directory - /usr/local/lib/ruby/gems/1.9.1/gems/eventmachine-1.0.3/ext` seems like it's still looking for the directory I just removed.... – zeroquaranta Jun 27 '14 at 13:10
  • http://stackoverflow.com/questions/1000731/getting-rid-of-ruby-gems-that-wont-die – Unixmonkey Jun 27 '14 at 13:22
  • unfortunately I cannot even run `gem clean`; any gem command fails with the error message above – zeroquaranta Jun 27 '14 at 13:30
  • 1
    Then blow away your entire gem folder. Don't worry too much, you should get everything back after `gem i bundler && bundle install` – Unixmonkey Jun 27 '14 at 13:58
  • So, I went to `/usr/local/lib/ruby/gems/1.9.1` and I cleaned out the subdorectories cache, gems, extensions, specifications. Then I launched the command you suggested and all the gems got reinstalled. Thanks!! – zeroquaranta Jun 27 '14 at 15:18

0 Answers0