无法加载此类文件 -- 脚本/导轨:通过 RubyMine 远程调试时出现此错误 [英] cannot load such file -- script/rails : Getting this error while remote debugging through RubyMine
问题描述
我在通过 RubyMine IDE 进行远程调试时遇到以下错误.
I am getting following error while remote debugging through RubyMine IDE.
$ bundle exec rdebug-ide --port 1234 -- script/rails server
Fast Debugger (ruby-debug-ide 0.4.9) listens on :1234
/home/amit/.rvm/gems/ruby-1.9.3-p125/gems/ruby-debug-ide19-0.4.12/lib/ruby-debug-ide.rb:123:in `debug_load'
/home/amit/.rvm/gems/ruby-1.9.3-p125/gems/ruby-debug-ide19-0.4.12/lib/ruby-debug-ide.rb:123:in `debug_program'
/home/amit/.rvm/gems/ruby-1.9.3-p125/gems/ruby-debug-ide19-0.4.12/bin/rdebug-ide:87:in `<top (required)>'
/home/amit/.rvm/gems/ruby-1.9.3-p125/bin/rdebug-ide:19:in `load'
/home/amit/.rvm/gems/ruby-1.9.3-p125/bin/rdebug-ide:19:in `<main>'
Uncaught exception: cannot load such file -- script/rails
我关注了此链接 安装远程调试所需的 gem.
I followed this link to install require gems for remote debug.
这里是远程调试的 Gemfile 配置
Here is Gemfile configuration for remote debug
#To Debug
gem 'linecache19', '0.5.13', :path => "~/.rvm/gems/ruby-1.9.3-p125/gems/linecache19-0.5.13/"
gem 'ruby-debug-base19', '0.11.26', :path => "~/.rvm/gems/ruby-1.9.3-p125/gems/ruby-debug-base19-0.11.26/"
gem 'ruby-debug19', :require => 'ruby-debug'
gem 'ruby-debug-ide19'
应用程序使用 Ruby 1.9.3 和 Rails 3.0.11 运行.
The application is running with Ruby 1.9.3 and Rails 3.0.11.
推荐答案
您正在使用一些奇怪的调试 gem,只需要以下内容:
You are using some weird debug gems, only the following are needed:
ruby-debug-base19x
ruby-debug-ide
首先,删除所有 ruby-debug*
gem,然后使用以下命令安装所需的 gem:
First, remove all the ruby-debug*
gems, then install the required gems using the following commands:
gem install ruby-debug-base19x --pre
gem install ruby-debug-ide --pre
您应该获得以下(或更新的)版本:
You should get the following (or newer) versions:
ruby-debug-base19x (0.11.30.pre10)
ruby-debug-ide (0.4.17.beta9)
调整您的 Gemfile
以仅包含这两个 gem(应用特定 gem 除外).
Adjust your Gemfile
to include only these two gems (except the app specific gems).
如果您收到与 linecache19
相关的错误,请按如下方式安装:
If you are getting linecache19
related errors, install it as follows:
curl -OL http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem
gem install linecache19-0.5.13.gem
@Anjan 为调试贡献了完整的 Gemfile 更改:
@Anjan has contributed the complete Gemfile changes for debugging:
gem 'linecache19', '>= 0.5.13', :git => 'https://github.com/robmathews/linecache19-0.5.13.git'
gem 'ruby-debug-base19x', '>= 0.11.30.pre10'
gem 'ruby-debug-ide', '>= 0.4.17.beta14'
不要忘记更新捆绑包.
这篇关于无法加载此类文件 -- 脚本/导轨:通过 RubyMine 远程调试时出现此错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!