Cannot get RubyMine to run or debug anything
Hi,
I can't seem to get RubyMine to do anything, even with simple code. For example, I tried both running and debugging the following snippet from a Ruby class. When debugging, it never gets to the breakpoint. When just running, it never displays anything.
The only thing that shows up in the Console window, seems to indicate that everything is running fine. But no results.
C:\Ruby\ruby\bin\ruby.exe -e "STDOUT.sync=true;STDERR.sync=true;load($0=ARGV.shift)" C:/Ruby/rails_apps/Lesson3/WhatThe/script/server default -p 1703 -b 127.0.0.1 -e development
=> Booting Mongrel (use 'script/server webrick' to force WEBrick)
=> Rails application starting on http://127.0.0.1:1703
=> Call with -d to detach
=> Ctrl-C to shutdown server
** Starting Mongrel listening at 127.0.0.1:1703
** Starting Rails with development environment...
** Rails loaded.
** Loading any Rails specific GemPlugins
** Signals ready. INT => stop (no restart).
** Mongrel 1.1.2 available at 127.0.0.1:1703
** Use CTRL-C to stop.
In both the Run and Debug menu, the Stop menuitem is available, which indicates that the code is running. However, in Debug, Step Over, Step Into, Pause, Resume, and all of the other debug-relevant items are disabled.
请先登录再写评论。
The snippet mentioned in the previous post is
family =
["Rich", "Barbara", "Katie Jane", "Jessica"]
family.each do |member|
puts member + " is a member of my family"
end
Also, port 3000 was tried, initially.
Hi DChild,
I suppose the problem is in compatibility of ruby-debug gems. Which versions of following gems do you use?
* ruby-debug
* ruby-debug-base
* ruby-debug-ide
If I'm reading this correctly,
ruby-debug 0.10.3
ruby-debug-base 0.10.3.1
ruby-debug-ide 0.4.5
\Ruby\ruby-debug-base-0.10.3.1-java.gem
\Ruby\ruby\lib\ruby\gems\1.8\gems\ruby-debug-base-0.10.3-x86-mswin32
\Ruby\ruby\lib\ruby\gems\1.8\gems\ruby-debug-ide-0.4.5
1.
This gem file isn't installed gem. More over it is gem for JRuby.
Please look for installed gems and it's version in output of command: C:\Ruby\ruby\bin\gem.bat list
2. Also please open RubyMine | Settings | Ruby SDK and Gems tab, select you Ruby interpreter (C:\Ruby\ruby\bin\ruby.exe), press "Attach Gems..." button. This dialog also display list of installed gems. Which versions of ruby-debug, ruby-debug-base, ruby-debug-ide listed in the dialog?
Thanks, Roman. This is what's installed, related to ruby-debug, along with some adjacent entries:
Partial output of gem.bat:
gem_plugin (0.2.3)
mongrel (1.1.2)
mysql (2.7.3)
rails (2.0.2)
rake (0.8.1, 0.8.0, 0.7.3)
ruby-debug-base (0.10.3)
ruby-debug-ide (0.4.5)
rubygems-update (1.0.1)
Under settings in RubyMine, there's nothing called ruby-debug. Is that the problem? Should the gems be re-installed?
ruby-debug nothing
ruby-debug-base 0.10.3
ruby-debug-ide 0.4.5
rubygems-update 1.0.1
Yes, I think it will help. You can install ruby-debug gem using RubyMine's Gem manager.
Ah, no luck so far.
Should anything in the background be run, like InstantRails, or is the IDE self-sufficient?
... another relevant piece of information is that there is no problem running a Ruby app from 1) the Instant Rails command line 2) a normal Dos or JPSoft command line, with the Ruby path set, 3) a text editor (MultiEdit). All of them show the output of the Ruby apps, without any errors.
When the app is Run from RubyMine, it seems to be in some kind of 'waiting' mode. When the app is Debugged from RubyMine, the Variables area shows 'Connected', but it goes nowhere.
The OS, by the way, is Vista Business Edition.
And which version of ruby-debug gem is installed?
Actually ruby-debug-ide gem provides java API for listening ruby process in debug mode. No additional background process is required.
It seems problem is in interaction of ruby-debug gems. By the way does RubyMine allow you to debug simple ruby script, e.g.
>>And which version of ruby-debug gem is installed?<<
0.10.3
It seems problem is in interaction of ruby-debug gems. By the way does RubyMine allow you to debug simple ruby script, e.g.
It won't debug any kind of simple script. I just tried the one you posted. It doesn't even get to the first line.
This configuration of gems works on my mac. Tomorrow we will try to reproduce your problem on Vista.
Roman,
Thanks for hold off. The actual Ruby.exe interpreter was version 1.8.6. This is because that verson seemed to be the only 'One-Click Installer' available at http://www.ruby-lang.org/en/downloads/
I overwrote the Ruby folders with 1.9.1 manually, copied over Zlib.dll, and am in the process of performing manual updates for the components.
Will play with it for a day or two, and let the forum know how it works out.
DChild,
RubyMine 1.0 will not support Ruby 1.9. It will have problems with Gem Manager, Tests Runner, etc. But we are going to support Ruby 1.9 in RubyMine 1.5 version.
I've just notice that you had some problems with running Rails application but yo log
shows that rails server was successfully launched on localhost, port 1703. Just open http://127.0.0.1:1703 in your internet browser.
>>RubyMine 1.0 will not support Ruby 1.9. It will have problems with Gem Manager, Tests Runner, etc. <<
Roman,
Yep, sure enough, haven't different problems since installing 1.9. Ok, sounds like a good time to clear out and start from scratch. These are the steps I'll follow schematically, but can you fill in some of the details, such as updating on the command line and from the IDE? Also, can you let me know which version of Ruby to use, and which is the best site to download from?
1. Uninstall Ruby by manually removing the C:\Ruby folder and contents. Backup up the project files first.
2. Reinstall RoB.
3. Reinstall RubyMine.
Aside form the above, what else should be done, to start with a clean slate?
Regards,
Please try adding these line to file idea.properties:
idea.is.internal=true
You'll be able to get ruby-debugger debug output info when running debug session in console.
Thanks,
Oleg
Message was edited by: Oleg Shpynov
You can use Ruby 1.8.6 or 1.8.7
4. Delete folder .RubyMine10 from you Windows user home directory
5. execute: gem list
and check that ruby-debug, ruby-debug-ide, ruby-debug-base aren't installed
6.Update rubygems because one click installer provides out of date version of rubygems package manager. For this execute in console
6. install gems, for this execute
7. Open RubyMine and create empty ruby project
8. Create any ruby script and try to debug it.
Ok Thanks, Roman. Gonna have to play with this a bit, before getting up to speed. I uninstalled everything, which took so long that it was necessary to put the PC in Safe mode, in order for the deletion process to move faster.
Ruby 1.87 is installed now, from http://rubyforge.org/frs/download.php/45906/rubygems-1.3.1.zip
InstantRails is not installed, because it is apparently built only for 1.86. RubyGems 1.3.1 was attempted, and most of it appears to be there - EXCEPT for the very important gem.bat.
According to the manual, it was necessary to run Ruby Setup.rb, but there's an error:
C:/Ruby/ruby/lib/ruby/1.8/fileutils.rb:1261:in `initialize': Permission denied - ruby/1.8/drb (Errno
::EACCES)
from C:/Ruby/ruby/lib/ruby/1.8/fileutils.rb:1261:in `open'
from C:/Ruby/ruby/lib/ruby/1.8/fileutils.rb:1261:in `copy_file'
from C:/Ruby/ruby/lib/ruby/1.8/fileutils.rb:463:in `copy_file'
from C:/Ruby/ruby/lib/ruby/1.8/fileutils.rb:844:in `install'
from C:/Ruby/ruby/lib/ruby/1.8/fileutils.rb:1395:in `fu_each_src_dest'
from C:/Ruby/ruby/lib/ruby/1.8/fileutils.rb:1411:in `fu_each_src_dest0'
from C:/Ruby/ruby/lib/ruby/1.8/fileutils.rb:1393:in `fu_each_src_dest'
from C:/Ruby/ruby/lib/ruby/1.8/fileutils.rb:840:in `install'
from C:/Ruby/ruby/lib/ruby/1.8/fileutils.rb:1527:in `install'
from setup.rb:159
from setup.rb:154:in `each'
from setup.rb:154
from setup.rb:151:in `chdir'
from setup.rb:151
Let's close this thread down, the problems are external to RubyMine. I'll try to search for some help on this more basic problem on the web, or possibly just clear out again, and install InstantRails, thereby completely installing 1.86. Not sure why the setup is so difficult, or why 1.87 and above isn't as well supported as 1.86.
Once it's all ready, if any problems with RMine, I'll start a new thread. Thanks for the assistance.
Regards,
1.
May be you problem is in permissions to folder C:/Ruby/ruby/ or it's subfolders?
2. We tested ruby 1.8.6 one click installer and ruby 1.8.7 archive (from official site). It seems all works on our Vista Business environment. In case of Ruby 1.8.6 one click installer is desired to update rubygems as I wrote above (execute: gem upate --system)
Good luck!
Oleg/Roman,
Ok, 1.87, RubyMine, and the gems are installed now. But I'm still not able to run or debug anything.
Run:
:\Ruby\bin\ruby.exe -e "STDOUT.sync=true;STDERR.sync=true;load($0=ARGV.shift)" C:/Users/DC/RubymineProjects/ThisOne/script/server default -p 3000 -b 127.0.0.1 -e development
=> Booting WEBrick...
=> Rails 2.2.2 application started on http://127.0.0.1:3000
=> Ctrl-C to shutdown server; call with --help for options
[2009-04-11 12:49:06] INFO WEBrick 1.3.1
[2009-04-11 12:49:06] INFO ruby 1.8.7 (2008-08-11) [i386-mswin32]
[2009-04-11 12:49:06] INFO WEBrick::HTTPServer#start: pid=3592 port=3000
I have http://localhost:3000/ running in Internet Explorer, and it points to initial instructions by the Rails people, "Welcome Aboard", etc.. It says to run script/generate to create the models and controllers; should I do that? Also, to set up a default Route in config/routes.rb. I haven't performed either of these two tasks, yet.
Trying to run a test script
counter = 1
while counter < 10
puts "The value is " + counter.to_s
counter = counter + 1
break if counter == 5
end
puts "The while loop is complete"
but nothing's happening, same as before. It's in some kind of waiting state.
Now, if we try the debugger, we get
C:\Ruby\bin\ruby.exe -e "STDOUT.sync=true;STDERR.sync=true;load($0=ARGV.shift)" C:\Ruby\bin/rdebug-ide --debug --port 1742 -- C:/Users/DC/RubymineProjects/ThisOne/script/server default -p 3000 -b 127.0.0.1 -e development
Fast Debugger (ruby-debug-ide 0.4.5) listens on localhost:1742
Starting command read loop
Processing: start
Starting: running program script
=> Booting WEBrick...
=> Rails 2.2.2 application started on http://127.0.0.1:3000
=> Ctrl-C to shutdown server; call with --help for options
[2009-04-11 12:56:32] INFO WEBrick 1.3.1
[2009-04-11 12:56:32] INFO ruby 1.8.7 (2008-08-11) [i386-mswin32]
[2009-04-11 12:56:32] INFO WEBrick::HTTPServer#start: pid=6000 port=3000
, and if I go ahead and run
http://localhost:1742/
, IE starts to try to connect, but nothing happens. "Website found. Waiting for reply...", but eventually it leads to a blank page showing a connection problem.
1.
If you see "Welcome abroad" page on http://localhost:3000/ it means that your server works fine. If you couldn't run rails application IE would show error that it is unable to load page. This page means that you rails application doesn't know to which controller it should redirect request (please consult with rails documentation, code examples)
E.g. in RM you can create controller(Context Menu in Project View | New | Controller) People with action hello. Than while you rails server is running open page in IE: http://localhost:3000/people/hello
2.
I copied this text to my RM #824(to file my_test_script.rb). Then I opened context menu in editor and choose "Run my_test_script". Then RM show me "4. Run" window with output
Can you reproduce this?
3.
You shouldn't open 1742 port. This port is used for communicating between RM and debugged application, not between user and application. E.g. if you create People controller you can put break point in PeopleController.hello() method. Then you should open link http://localhost:3000/people/hello and debugger will pause execution on code in hello() method.
>>Can you reproduce this?<<
Yes. The missing piece was the context menu. I was attempting to Run and Debug, from the main Run menu. But nothing happens, of course.
When Run or Debug is selected from the context menu, everything works as expected.
Good. Now I can get my homework done.
Thanks, Roman. The problem in this thread is resolved.
Run/Debug buttons launches run configuration which is shown in combobox before buttons. RM have to actions for run - run current(selected) Run Configuration Shift+F10, and run configuration for context at cursor Ctrl+Shift+F10 (the same as in context menu).