Rails with Ruby-Debugger Throw 'Symbol Not Found: _Ruby_Current_Thread (Loaderror)'

Rails with ruby-debugger throw 'Symbol not found: _ruby_current_thread (LoadError)'

UPDATE:

Looks like you only need to put this in your gemfile:

gem "debugger"

and now works.

Old article follows

====================================

Jerome is correct, but lacking in the details. Here is the blow by blow, taken from this https://gist.github.com/1331533, in particular thanks to andrewroth's post. I've tested this as of the time of this post. One hopes that the changes will be deployed somewhere standard soon.

Installing ruby debugger on ruby 1.9.3-p125: 

export PATCH_LEVEL=`ruby -e 'puts RUBY_PATCHLEVEL'`
export RVM_SRC=$HOME/.rvm/rubies/ruby-1.9.3-p$PATCH_LEVEL/include/ruby-1.9.1
gem install archive-tar-minitar
gem install ruby_core_source -- --with-ruby-include=/$RVM_SRC
export RVM_SRC=$HOME/.rvm/rubies/ruby-1.9.3-p$PATCH_LEVEL/include/ruby-1.9.1/ruby-1.9.3-p$PATCH_LEVEL

wget http://rubyforge.org/frs/download.php/75415/ruby-debug-base19-0.11.26.gem
wget http://rubyforge.org/frs/download.php/63094/ruby-debug19-0.11.6.gem
wget http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem
gem install linecache19-0.5.13.gem -- --with-ruby-include=/$RVM_SRC
# if that step failed, and you are running OSX Lion, then following this post can help you:
# http://stackoverflow.com/questions/8032824/cant-install-ruby-under-lion-with-rvm-gcc-issues
# this happens if you recently installed xcode from the app store.
# bizarrely, for me I had to do this: ln -s /usr/bin/gcc /usr/bin/gcc-4.2
gem install ruby-debug-base19-0.11.26.gem -- --with-ruby-include=/$RVM_SRC

Then edit Gemfile:

gem 'linecache19', '0.5.13', :path => "~/.rvm/gems/ruby-1.9.3-p#{RUBY_PATCHLEVEL}/gems/linecache19-0.5.13/"
gem 'ruby-debug-base19', '0.11.26', :path => "~/.rvm/gems/ruby-1.9.3-p#{RUBY_PATCHLEVEL}/gems/ruby-debug-base19-0.11.26/"
gem 'ruby-debug19', :require => 'ruby-debug'

Then install:

bundle install

Cannot use ruby-debug19 with 1.9.3-p0?

UPDATE: ruby-debug19 is not maintained anymore. This question and my answer have become irrelevant, it's far easier to use the 'debugger' gem instead.

See Debugging in ruby 1.9

I also ran into this, and found the solution in Ruby 1.9.3 and ruby-debug. You need to install not-yet-officially-released versions of ruby-debug-base19 and linecache19. The currently released versions indeed cause the exception you had.

Use this gist.

#To install ruby-debug on Ubuntu ruby-1.9.3 you need to download from http://rubyforge.org/frs/?group_id=8883

linecache19-0.5.13.gem
ruby_core_source-0.1.5.gem
ruby-debug19-0.11.6.gem
ruby-debug-base19-0.11.26.gem

#Then in your console

export RVM_SRC=/your/path/to/ruby-1.9.3
# Note, your source path should be something like /home/user/.rvm/src/ruby-1.9.3-p0

gem install archive-tar-minitar
gem install ruby_core_source-0.1.5.gem -- --with-ruby-include=/$RVM_SRC
gem install linecache19-0.5.13.gem -- --with-ruby-include=/$RVM_SRC
gem install ruby-debug-base19-0.11.26.gem -- --with-ruby-include=/$RVM_SRC
gem install ruby-debug19-0.11.6.gem -- --with-ruby-include=/$RVM_SRC

bundle install circular dependencies

If anyone turns out to be stuck on this what turned out to be the answer is one of our homegrown gems:

gem "xfire-api", :path => "vendor/gems/xfire-api"

had a require in it provided by a gem that was not specified in the gemspec. If you're stuck on this and have homegrown gems take a look through all your requires and makes sure all the files are provided by gems you specify in the Gemspec.

Ignoring GEM because its extensions are not built

I came across this exact issue today - getting warnings like this for gems that weren't even installed!

... Well, it turns out the gems were installed - for a different ruby than the one I had set active with chruby (2.2.3 vs 2.3.1).

Switching to all the different rubies and running gem pristine --all on all of them solved the problem.

Can't install Ruby under Lion with RVM – GCC issues

This answer was edited multiple times and now contains several alternative solutions. Try the simple “Edit 3” solution first.

Ruby 1.9.3-p125 and later have official support for clang, so if you are installing such a version you should not need GCC. If you’re installing an older version of Ruby, read on.

To compile Ruby with GCC, you need a non-LLVM version of GCC, which is no longer included with Xcode 4.2. Install it yourself (or downgrade to Xcode 4.1 temporarily), then do CC=/usr/local/bin/gcc-4.2 rvm install 1.9.3 --enable-shared (substituting the path to your non-LLVM gcc).

Edit: https://github.com/kennethreitz/osx-gcc-installer/downloads may help for installing GCC. There is also some info available by running rvm requirements.

Edit 2: For an easier solution, you can try adding --with-gcc=clang to the arguments to configure for Ruby to use clang instead of GCC.

Edit 3: rvm install 1.9.3 --with-gcc=clang does that for you.

Note: With current versions of Xcode you need to install the command-line tools separately from the Xcode menu -> Preferences -> Downloads -> Components. This is a pre-requisite for doing any compiling with Xcode on the command-line, not just Ruby.

Note 2: If something doesn't work after following the steps, try doing a reboot or re-login to ensure that the environment gets set correctly.

Note 3: Ruby versions prior to 1.9.3-p125 may not always be fully compatible with clang, so test your software thoroughly if using the “edit 3” solution in a production environment.

Homebrew fails on MacOS Big Sur

I had the same problem. Try upgrading brew - this solved it for me.

brew upgrade

dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib

Update: As of December 2020 and beyond, brew switch does not work, so use the other answer by @angabriel:

brew install rbenv/tap/openssl@1.0
ln -sfn /usr/local/Cellar/openssl@1.0/1.0.2t /usr/local/opt/openssl

Original Answer:
Switch to an older openssl package

brew switch openssl 1.0.2s

Or, depending on your exact system configuration, you may need to switch to a different version. Check the output of ls -al /usr/local/Cellar/openssl for the version number to switch to.

brew switch openssl 1.0.2q
# or
brew switch openssl 1.0.2r
# or
brew switch openssl 1.0.2s
# or
brew switch openssl 1.0.2t
# etc...


Related Topics



Leave a reply



Submit