带有 ruby​​-debugger 的 Rails 抛出“找不到符号:_ruby_current_thread (LoadError)" [英] Rails with ruby-debugger throw 'Symbol not found: _ruby_current_thread (LoadError)'

查看:39
本文介绍了带有 ruby​​-debugger 的 Rails 抛出“找不到符号:_ruby_current_thread (LoadError)"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有标准的 ruby​​-head 和 Rails 3.1rc4.我按照 的说明安装了 ruby​​-debughttp://dirk.net/2010/04/17/ruby-debug-with-ruby-19x-and-rails-3-on-rvm/

I have standard ruby-head and Rails 3.1rc4. I installed ruby-debug with following instructions from http://dirk.net/2010/04/17/ruby-debug-with-ruby-19x-and-rails-3-on-rvm/

但是当我运行 rails s --debugger 它会抛出这个奇怪的错误

But when i run rails s --debugger it will throw this strange error

/Users/schovi/.rvm/gems/ruby-head/gems/activesupport-3.1.0.rc4/lib/active_support/dependencies.rb:237:in `require': dlopen(/Users/schovi/.rvm/gems/ruby-head/gems/linecache19-0.5.12/lib/trace_nums19.bundle, 9): Symbol not found: _ruby_current_thread (LoadError)
  Referenced from: /Users/schovi/.rvm/gems/ruby-head/gems/linecache19-0.5.12/lib/trace_nums19.bundle
  Expected in: flat namespace
in /Users/schovi/.rvm/gems/ruby-head/gems/linecache19-0.5.12/lib/trace_nums19.bundle - /Users/schovi/.rvm/gems/ruby-head/gems/linecache19-0.5.12/lib/trace_nums19.bundle
from /Users/schovi/.rvm/gems/ruby-head/gems/activesupport-3.1.0.rc4/lib/active_support/dependencies.rb:237:in `block in require'
from /Users/schovi/.rvm/gems/ruby-head/gems/activesupport-3.1.0.rc4/lib/active_support/dependencies.rb:223:in `block in load_dependency'

有什么想法吗?谢谢,大卫

Any idea? Thanks, David

推荐答案

更新:

看起来你只需要把它放在你的 gemfile 中:

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

宝石调试器"

现在可以使用了.

旧文章如下

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

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

Jerome 是对的,但缺乏细节.这是一举一动,摘自 https://gist.github.com/1331533,特别感谢 andrewroth 的帖子.截至本文发布时,我已经对此进行了测试.人们希望这些更改很快就会部署到某个标准的地方.

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

这篇关于带有 ruby​​-debugger 的 Rails 抛出“找不到符号:_ruby_current_thread (LoadError)"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆