RubyMine 中的 Ruby 调试器
我尝试在 Rubymine 中运行调试器,但不断收到此错误。
/Users/skline/.rvm/rubies/ruby-1.9.2-p136/bin/ruby -e at_exit{sleep(1)};$stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/skline/.rvm/gems/ruby-1.9.2-p136/gems/ruby-debug-ide-0.4.17.beta3/bin/rdebug-ide --port 49877 -- /Users/skline/Sites/2t2/app/mailers/user_notifications.rb
Fast Debugger (ruby-debug-ide 0.4.17.beta3, ruby-debug-base 0.11.26) listens on 127.0.0.1:49877
<internal:lib/rubygems/custom_require>:29:in `require'
<internal:lib/rubygems/custom_require>:29:in `require'
/Users/skline/Sites/2t2/app/mailers/user_notifications.rb:1:in `<top (required)>'
/Users/skline/.rvm/gems/ruby-1.9.2-p136/gems/ruby-debug-ide-0.4.17.beta3/lib/ruby-debug-ide.rb:112:in `debug_load'
/Users/skline/.rvm/gems/ruby-1.9.2-p136/gems/ruby-debug-ide-0.4.17.beta3/lib/ruby-debug-ide.rb:112:in `debug_program'
/Users/skline/.rvm/gems/ruby-1.9.2-p136/gems/ruby-debug-ide-0.4.17.beta3/bin/rdebug-ide:87:in `<top (required)>'
-e:1:in `load'
-e:1:in `<main>'
Uncaught exception: no such file to load -- safe_mailer
Process finished with exit code 0
有什么想法吗?
I am trying to run the debugger in Rubymine and I keep getting this error.
/Users/skline/.rvm/rubies/ruby-1.9.2-p136/bin/ruby -e at_exit{sleep(1)};$stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/skline/.rvm/gems/ruby-1.9.2-p136/gems/ruby-debug-ide-0.4.17.beta3/bin/rdebug-ide --port 49877 -- /Users/skline/Sites/2t2/app/mailers/user_notifications.rb
Fast Debugger (ruby-debug-ide 0.4.17.beta3, ruby-debug-base 0.11.26) listens on 127.0.0.1:49877
<internal:lib/rubygems/custom_require>:29:in `require'
<internal:lib/rubygems/custom_require>:29:in `require'
/Users/skline/Sites/2t2/app/mailers/user_notifications.rb:1:in `<top (required)>'
/Users/skline/.rvm/gems/ruby-1.9.2-p136/gems/ruby-debug-ide-0.4.17.beta3/lib/ruby-debug-ide.rb:112:in `debug_load'
/Users/skline/.rvm/gems/ruby-1.9.2-p136/gems/ruby-debug-ide-0.4.17.beta3/lib/ruby-debug-ide.rb:112:in `debug_program'
/Users/skline/.rvm/gems/ruby-1.9.2-p136/gems/ruby-debug-ide-0.4.17.beta3/bin/rdebug-ide:87:in `<top (required)>'
-e:1:in `load'
-e:1:in `<main>'
Uncaught exception: no such file to load -- safe_mailer
Process finished with exit code 0
Any thoughts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
它看起来像是您的应用程序中的 gem 或其他依赖项发生了更改。您报告的错误似乎嵌入了答案:检查您的 /app/mailers/user_notifications.rb 并查看第 1 行所要求的要求。然后查看第 29 行的 lib/rubygems/custom_require。这两个文件之一似乎要求提供一些它无法找到的内容。我对您正在使用的 gem 没有经验,但似乎您可能错过了 gem 依赖项,有 Gem 版本错误,或者包含不再存在或已移动/更改名称的内容的语句。
It looks like a gem or other dependency changed in your app. The error you're reporting seems to have the answer embedded in it: check your /app/mailers/user_notifications.rb and see what requirement line 1 is calling for. Then look at lib/rubygems/custom_require at line 29. One of those two files appears to be asking for something that it can't find. I've no experience with the gem you are using, but it seems you may have missed a gem dependency, have a Gem version error, or an Include statement for something that no longer exists or has moved/changed names.
问题
我在使用 Run > 时遇到了类似的错误使用 RubyMine 2016.2.4 进行调试。
最初,当我在示例 ruby 文件 team.rb 中设置断点并运行 Run > 时,调试它有效(控制台显示
0>
而不是Process finish with exit code 0
)班级团队
attr_reader:大小
def 初始化(大小)
@尺寸=尺寸
结尾
结尾
团队 = 团队.new(100)
我花了几个小时试图解决这个问题,但没有成功,遵循互联网上的帖子。我准备重新安装 RubyMine,并决定联系他们的支持电子邮件。我告诉我已经尝试了一切,例如:
rm -rf .idea
gem pristine --all
rvm install 2.1.2
rvm list
rvm use 2.1.2
)rvm -v< /code> rvm 1.26.11
gem env
和which ruby
检查 gem 的位置。这表明它们与 /usr/bin/ruby 和 /Users/Ls/.rvm/rubies/ruby-2.3.0/bin/rubygem uninstall ...
)相关全局 Ruby 位置和默认 RVM 中的 gem<代码>
$ gem 安装 debug_inspector
$ gem 安装调试器-linecache
$ gem 安装 ruby-debug-ide
$ gem install debase
$ gem install debase-ruby_core_source
$ gem install -i /Users/Ls/.rvm/gems/ruby-2.3.0@global debug_inspector
$ gem install -i /Users/Ls/.rvm/gems/ruby-2.3.0@global debug-linecache
$ gem install -i /Users/Ls/.rvm/gems/ruby-2.3.0@global ruby-debug-ide
$ gem install -i /Users/Ls/.rvm/gems/ruby-2.3.0@global debase
$ gem install -i /Users/Ls/.rvm/gems/ruby-2.3.0@global debase-ruby_core_source
$ gem 安装 linecache19-0.5.13.gem
bundle update
解决方案
我从 RubyMine 得到了反馈支持人员建议我向他们展示 gem list 的输出并打开详细输出(设置 > 构建、执行、部署 > 调试器 > 详细调试器)。
他们的反馈没有立即回复,而是给了我一个强有力的线索,这一定是由宝石冲突引起的,所以我尝试了以下方法,让它再次工作!
文件>使缓存和缓存无效重新启动>使缓存和缓存无效重新启动
$ GEM_PATH=$GEM_HOME 宝石列表
本地宝石
降低 (0.2.1)
debase-ruby_core_source (0.9.2)
调试检查器 (0.0.2)
调试器行缓存 (1.2.0)
行缓存19 (0.5.13)
红宝石调试IDE(0.6.1.beta2,0.6.0)
ruby_core_source (0.1.5)
<代码>
$ rvm ruby-2.3.0 做 gem 列表
本地宝石
降低 (0.2.1)
debase-ruby_core_source (0.9.2)
调试检查器 (0.0.2)
调试器行缓存 (1.2.0)
行缓存19 (0.5.13)
红宝石调试IDE(0.6.1.beta2,0.6.0)
ruby_core_source (0.1.5)
<代码>
$ rvm ruby-2.3.0 @global 做 gem 列表
本地宝石
降低 (0.2.1)
debase-ruby_core_source (0.9.2)
调试检查器 (0.0.2)
行缓存19 (0.5.13)
红宝石调试IDE (0.6.0)
<代码>
$ rvm 安装 ruby-2.3.1
$ rvm ruby-2.3.1 做 gem 列表
$ rvm ruby-2.3.1 @global 做 gem 列表
本地宝石
大十进制 (1.2.8)
did_you_mean (1.0.0)
宝石包装 (1.2.7)
io-控制台 (0.4.5)
json (1.8.3)
迷你测试 (5.8.3)
网络远程登录 (0.1.1)
power_assert (0.2.6)
心理 (2.0.17)
耙子 (10.4.2)
rdoc (4.2.1)
RVM (1.11.3.9)
测试单元 (3.1.5)
<代码>
$ rvm -v
$ rvm 变得稳定
$ rvm重新加载
$ rvm列表
rvm ruby-2.3.1 do rvm gemset create rubymine_2016_4_2
<代码>
$ 红宝石 -v
ruby 2.3.1p112(2016-04-26 修订版 54768)[x86_64-darwin15]
$ rvm ruby-2.3.1@rubymine_2016_2_4 做 gem 列表
本地宝石
大十进制 (1.2.8)
降低(0.2.2.beta8,0.2.1)
debase-ruby_core_source (0.9.2)
did_you_mean (1.0.0)
宝石包装 (1.2.7)
io-控制台 (0.4.5)
json (1.8.3)
迷你测试 (5.8.3)
网络远程登录 (0.1.1)
power_assert (0.2.6)
心理 (2.0.17)
耙子 (10.4.2)
rdoc (4.2.1)
ruby-debug-ide (0.6.1.beta2)
RVM (1.11.3.9)
测试单元 (3.1.5)
0>
而不是Process finish with exit code 0
Problem
I got a similar error when using Run > Debug using RubyMine 2016.2.4.
Initially when I set a breakpoint in a sample ruby file team.rb and ran Run > Debug it worked (console it displayed
0>
instead ofProcess finished with exit code 0
)class Team
attr_reader :size
def initialize(size)
@size = size
end
end
team = Team.new(100)
I spent hours trying to resolve it without success, following posts on the internet. I was ready to reinstall RubyMine, and I decided to contact their support email. I told I had tried everything, such as:
rm -rf .idea
gem pristine --all
rvm install 2.1.2
rvm list
rvm use 2.1.2
)rvm -v
rvm 1.26.11gem env
andwhich ruby
. This indicated they are in both in /usr/bin/ruby and /Users/Ls/.rvm/rubies/ruby-2.3.0/bin/rubygem uninstall ...
) relevant gems in both the global Ruby location and default RVM$ gem install debug_inspector
$ gem install debugger-linecache
$ gem install ruby-debug-ide
$ gem install debase
$ gem install debase-ruby_core_source
$ gem install -i /Users/Ls/.rvm/gems/ruby-2.3.0@global debug_inspector
$ gem install -i /Users/Ls/.rvm/gems/ruby-2.3.0@global debug-linecache
$ gem install -i /Users/Ls/.rvm/gems/ruby-2.3.0@global ruby-debug-ide
$ gem install -i /Users/Ls/.rvm/gems/ruby-2.3.0@global debase
$ gem install -i /Users/Ls/.rvm/gems/ruby-2.3.0@global debase-ruby_core_source
$ gem install linecache19-0.5.13.gem
bundle update
Solution
I got feedback from RubyMine Support suggesting that I show them the output of
gem list
and to turn on Verbose Output (Settings > Build, Execution, Deployment > Debugger > Verbose debugger).Instead of responding immediately their feedback gave me a strong clue it must be caused by a gem conflict, so I tried the following approach, which got it to work again!
File > Invalidate Caches & Restart > Invalidate Caches & Restart
$ GEM_PATH=$GEM_HOME gem list
LOCAL GEMS
debase (0.2.1)
debase-ruby_core_source (0.9.2)
debug_inspector (0.0.2)
debugger-linecache (1.2.0)
linecache19 (0.5.13)
ruby-debug-ide (0.6.1.beta2, 0.6.0)
ruby_core_source (0.1.5)
$ rvm ruby-2.3.0 do gem list
LOCAL GEMS
debase (0.2.1)
debase-ruby_core_source (0.9.2)
debug_inspector (0.0.2)
debugger-linecache (1.2.0)
linecache19 (0.5.13)
ruby-debug-ide (0.6.1.beta2, 0.6.0)
ruby_core_source (0.1.5)
$ rvm ruby-2.3.0 @global do gem list
LOCAL GEMS
debase (0.2.1)
debase-ruby_core_source (0.9.2)
debug_inspector (0.0.2)
linecache19 (0.5.13)
ruby-debug-ide (0.6.0)
$ rvm install ruby-2.3.1
$ rvm ruby-2.3.1 do gem list
$ rvm ruby-2.3.1 @global do gem list
LOCAL GEMS
bigdecimal (1.2.8)
did_you_mean (1.0.0)
gem-wrappers (1.2.7)
io-console (0.4.5)
json (1.8.3)
minitest (5.8.3)
net-telnet (0.1.1)
power_assert (0.2.6)
psych (2.0.17)
rake (10.4.2)
rdoc (4.2.1)
rvm (1.11.3.9)
test-unit (3.1.5)
$ rvm -v
$ rvm get stable
$ rvm reload
$ rvm list
rvm ruby-2.3.1 do rvm gemset create rubymine_2016_4_2
$ ruby -v
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]
$ rvm ruby-2.3.1@rubymine_2016_2_4 do gem list
LOCAL GEMS
bigdecimal (1.2.8)
debase (0.2.2.beta8, 0.2.1)
debase-ruby_core_source (0.9.2)
did_you_mean (1.0.0)
gem-wrappers (1.2.7)
io-console (0.4.5)
json (1.8.3)
minitest (5.8.3)
net-telnet (0.1.1)
power_assert (0.2.6)
psych (2.0.17)
rake (10.4.2)
rdoc (4.2.1)
ruby-debug-ide (0.6.1.beta2)
rvm (1.11.3.9)
test-unit (3.1.5)
0>
instead ofProcess finished with exit code 0