質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

RubyGems

RubyGemsはRubyによるプログラミングのためのパッケージマネジメントツールです。ユーザはこれを使用することで、Rubyライブラリのダウンロードやアップデートや、依存関係の自動解決が可能になります。

Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

RubyMine

RubyMineは、Ruby/Ruby on RailsベースのWebアプリケーション開発を行うためのIDEです。コードエディタやコードアシスタンス、グラフィカルなデバッガを搭載しており、様々なバージョン管理システムに対応しています。

Q&A

解決済

1回答

1350閲覧

RubyMineでデバック実行(虫眼鏡)がうまくいかない

oyj1217

総合スコア7

Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

RubyGems

RubyGemsはRubyによるプログラミングのためのパッケージマネジメントツールです。ユーザはこれを使用することで、Rubyライブラリのダウンロードやアップデートや、依存関係の自動解決が可能になります。

Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

RubyMine

RubyMineは、Ruby/Ruby on RailsベースのWebアプリケーション開発を行うためのIDEです。コードエディタやコードアシスタンス、グラフィカルなデバッガを搭載しており、様々なバージョン管理システムに対応しています。

1グッド

1クリップ

投稿2017/09/22 03:33

###前提・実現したいこと
RubyMineで以前作ったRailsアプリをデバック(虫眼鏡)を実行しても以下のようなメッセージが出て実行できません。
イメージ説明

###発生している問題・エラーメッセージ

/Users/oyj1217/.rbenv/versions/2.2.4/bin/ruby -e at_exit{sleep(1)};$stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/oyj1217/RailsFolder/Kensetu/vendor/bundle/ruby/2.2.0/gems/ruby-debug-ide-0.6.1.beta3/bin/rdebug-ide --disable-int-handler --evaluation-timeout 10 --evaluation-control --time-limit 100 --memory-limit 10 --rubymine-protocol-extensions --port 64367 --host 0.0.0.0 --dispatcher-port 64368 -- /Users/oyj1217/RailsFolder/Kensetu/bin/rails server -b 0.0.0.0 -p 3000 -e development Using ruby-debug-base 0.2.1 Usage: rdebug-ide is supposed to be called from RDT, NetBeans, RubyMine, or the IntelliJ IDEA Ruby plugin. The command line interface to ruby-debug is rdebug. Options: -h, --host HOST Host name used for remote debugging -p, --port PORT Port used for remote debugging --dispatcher-port PORT Port used for multi-process debugging dispatcher --evaluation-timeout TIMEOUT evaluation timeout in seconds (default: 10) --stop stop when the script is loaded -x, --trace turn on line tracing -l, --load-mode load mode (experimental) -d, --debug Debug self - prints information for debugging ruby-debug itself --xml-debug Debug self - sends information <message>s for debugging ruby-debug itself -I, --include PATH Add PATH to $LOAD_PATH --attach-mode Tells that rdebug-ide is working in attach mode --keep-frame-binding Keep frame bindings --disable-int-handler Disables interrupt signal handler --rubymine-protocol-extensions Enable all RubyMine-specific incompatible protocol extensions --catchpoint-deleted-event Enable chatchpointDeleted event --value-as-nested-element Allow to pass variable's value as nested element instead of attribute Common options: -v, --version Show version invalid option: --evaluation-control Process finished with exit code 1 ###補足情報(言語/FW/ツール等のバージョンなど) RubyMineの以前のバージョンではなにも問題なくデバック実行できていました。 最新バージョン2017.2にしたのち、このようなエラーがでます。 Rubyバージョン:2.2.4 Rails:4.2.6 ご教授よろしくお願いいたします。
fussy113👍を押しています

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

私もRubyMine: 2017.2で同じエラーになりましたが、gem 'ruby-debug-ide'を0.6.1.beta9にすることでデバッグできるようになりました。

具体的には、私はGemfileを下記のようにしています。

group :development, :test do gem 'ruby-debug-ide', '0.6.1.beta9' gem 'debase' end

なぜ、0.6.1.beta9 にしたかというと、
上記に貼られているRubyMineがデバッグ実行している一行目のコマンド --evaluation-controlがパラメータとして付けられているんですが、最後から上に2行目のエラーメッセージ invalid option: --evaluation-control と表示されているように、パラメータを不正としてエラーにしているようですね。

そして、これに関する処理が ruby-debug-ideの0.6.1.beta9で記述されていました

https://github.com/ruby-debug/ruby-debug-ide/commit/02148f5296b5c30ef0b436358a54217c33e9713c

バージョンを変更し、エラーにならずに解決した際のRubyMineのコンソールを見ると、2行目 ruby-debug-ide 0.6.1.beta9 となっているのがわかります。

ruby -e at_exit{sleep(1)};$$stdout.sync=true;$$stderr.sync=true;load($$0=ARGV.shift) /opt/project/vendor/bundle/ruby/2.4.0/gems/ruby-debug-ide-0.6.1.beta9/bin/rdebug-ide --disable-int-handler --evaluation-timeout 10 --evaluation-control --time-limit 100 --memory-limit 10 --rubymine-protocol-extensions --port 1234 --host 0.0.0.0 --dispatcher-port 26168 -- /opt/project/bin/rails server -b 0.0.0.0 -p 3000 -e development Fast Debugger (ruby-debug-ide 0.6.1.beta9, debase 0.2.1, file filtering is supported) listens on 0.0.0.0:1234 => Booting Puma => Rails 5.1.2 application starting in development on http://0.0.0.0:3000 => Run `rails server -h` for more startup options Puma starting in single mode... * Version 3.9.1 (ruby 2.4.1-p111), codename: Private Caller * Min threads: 5, max threads: 5 * Environment: development * Listening on tcp://0.0.0.0:3000 Use Ctrl-C to stop

何か参考になればとおもいます。

補足情報(言語/FW/ツール等のバージョンなど)

RubyMine: 2017.2
Ruby:2.4.1
Rails: 5.1.2

投稿2017/09/23 06:29

編集2017/09/23 12:32
yimajo

総合スコア25

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

oyj1217

2017/09/25 01:48

ご返答ありがとうございます。 ご指示通り実行した結果、以下の表示となります。 /Users/oyj1217/.rbenv/versions/2.2.4/bin/ruby -e at_exit{sleep(1)};$stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/oyj1217/RailsFolder/Kensetu/vendor/bundle/ruby/2.2.0/gems/ruby-debug-ide-0.6.1.beta9/bin/rdebug-ide --disable-int-handler --evaluation-timeout 10 --evaluation-control --time-limit 100 --memory-limit 10 --rubymine-protocol-extensions --port 61951 --host 0.0.0.0 --dispatcher-port 61952 -- /Users/oyj1217/RailsFolder/Kensetu/bin/rails server -b 0.0.0.0 -p 3000 -e development Fast Debugger (ruby-debug-ide 0.6.1.beta9, debase 0.2.1, file filtering is supported) listens on 0.0.0.0:61951 => Booting Thin => Rails 4.2.6 application starting in development on http://0.0.0.0:3000 => Run `rails server -h` for more startup options => Ctrl-C to shutdown server Exiting A server is already running. Check /Users/oyj1217/RailsFolder/Kensetu/tmp/pids/server.pid. Process finished with exit code 1 引き続きご指導よろしくお願いします
yimajo

2017/09/25 01:54

> A server is already running. Check /Users/oyj1217/RailsFolder/Kensetu/tmp/pids/server.pid. と書かれているので、すでにプロセスが存在している状態で起動しようとしてエラーになってますね。 この解決方法は色々あると思いますが、手っ取り早いのは /Users/oyj1217/RailsFolder/Kensetu/tmp/pids/server.pid を削除するなどしてもう一度RubyMineから実行してみて下さい。 具体的には下記とか ``` rm /Users/oyj1217/RailsFolder/Kensetu/tmp/pids/server.pid ``` 他には ``` cat /Users/oyj1217/RailsFolder/Kensetu/tmp/pids/server.pid ``` でプロセスのIDが分かればkillコマンドでそのプロセスを停止するなどです。
oyj1217

2017/09/25 02:46

yimajo様、すばやいご返答ありがとうございます。 >この解決方法は色々あると思いますが、手っ取り早いのは /Users/oyj1217/RailsFolder/Kensetu/tmp/pids/server.pid を削除するなどしてもう一度RubyMineから実行してみて下さい。 上記、行いRubyMine再起動後デバック実行した結果です。 /Users/oyj1217/.rbenv/versions/2.2.4/bin/ruby -e at_exit{sleep(1)};$stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/oyj1217/RailsFolder/Kensetu/vendor/bundle/ruby/2.2.0/gems/ruby-debug-ide-0.6.1.beta9/bin/rdebug-ide --disable-int-handler --evaluation-timeout 10 --evaluation-control --time-limit 100 --memory-limit 10 --rubymine-protocol-extensions --port 65416 --host 0.0.0.0 --dispatcher-port 65417 -- /Users/oyj1217/RailsFolder/Kensetu/bin/rails server -b 0.0.0.0 -p 3000 -e development Fast Debugger (ruby-debug-ide 0.6.1.beta9, debase 0.2.1, file filtering is supported) listens on 0.0.0.0:65416 => Booting Thin => Rails 4.2.6 application starting in development on http://0.0.0.0:3000 => Run `rails server -h` for more startup options => Ctrl-C to shutdown server Thin web server (v1.7.2 codename Bachmanity) Maximum connections set to 1024 Listening on 0.0.0.0:3000, CTRL+C to stop Uncaught exception: no acceptor (port is in use or requires root privileges) /Users/oyj1217/RailsFolder/Kensetu/vendor/bundle/ruby/2.2.0/gems/eventmachine-1.2.5/lib/eventmachine.rb:530:in `start_tcp_server' /Users/oyj1217/RailsFolder/Kensetu/vendor/bundle/ruby/2.2.0/gems/eventmachine-1.2.5/lib/eventmachine.rb:530:in `start_server' /Users/oyj1217/RailsFolder/Kensetu/vendor/bundle/ruby/2.2.0/gems/thin-1.7.2/lib/thin/backends/tcp_server.rb:16:in `connect' /Users/oyj1217/RailsFolder/Kensetu/vendor/bundle/ruby/2.2.0/gems/thin-1.7.2/lib/thin/backends/base.rb:63:in `block in start' /Users/oyj1217/RailsFolder/Kensetu/vendor/bundle/ruby/2.2.0/gems/eventmachine-1.2.5/lib/eventmachine.rb:194:in `call' /Users/oyj1217/RailsFolder/Kensetu/vendor/bundle/ruby/2.2.0/gems/eventmachine-1.2.5/lib/eventmachine.rb:194:in `run_machine' /Users/oyj1217/RailsFolder/Kensetu/vendor/bundle/ruby/2.2.0/gems/eventmachine-1.2.5/lib/eventmachine.rb:194:in `run' /Users/oyj1217/RailsFolder/Kensetu/vendor/bundle/ruby/2.2.0/gems/thin-1.7.2/lib/thin/backends/base.rb:73:in `start' /Users/oyj1217/RailsFolder/Kensetu/vendor/bundle/ruby/2.2.0/gems/thin-1.7.2/lib/thin/server.rb:162:in `start' /Users/oyj1217/RailsFolder/Kensetu/vendor/bundle/ruby/2.2.0/gems/rack-1.6.8/lib/rack/handler/thin.rb:19:in `run' /Users/oyj1217/RailsFolder/Kensetu/vendor/bundle/ruby/2.2.0/gems/rack-1.6.8/lib/rack/server.rb:287:in `start' /Users/oyj1217/RailsFolder/Kensetu/vendor/bundle/ruby/2.2.0/gems/railties-4.2.6/lib/rails/commands/server.rb:80:in `start' /Users/oyj1217/RailsFolder/Kensetu/vendor/bundle/ruby/2.2.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:80:in `block in server' /Users/oyj1217/RailsFolder/Kensetu/vendor/bundle/ruby/2.2.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:75:in `tap' /Users/oyj1217/RailsFolder/Kensetu/vendor/bundle/ruby/2.2.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:75:in `server' /Users/oyj1217/RailsFolder/Kensetu/vendor/bundle/ruby/2.2.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:39:in `run_command!' /Users/oyj1217/RailsFolder/Kensetu/vendor/bundle/ruby/2.2.0/gems/railties-4.2.6/lib/rails/commands.rb:17:in `<top (required)>' /Users/oyj1217/RailsFolder/Kensetu/bin/rails:4:in `require' /Users/oyj1217/RailsFolder/Kensetu/bin/rails:4:in `<top (required)>' Exiting Process finished with exit code 0
oyj1217

2017/09/25 03:05

yimajo様、pc再起動後実行したら、うまくいきました。 ありがとうございました。 感謝いたします。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問