-
Notifications
You must be signed in to change notification settings - Fork 286
Can't launch rails app #62
Comments
Hi @germangrasso, it seems like the debug server isn't starting up correctly. Do you have ruby-debug-ide installed? If so, are you running VS Code from a shortcut icon or from the command line. If you're running from an icon, you may be getting the default ruby version of the system rather than the one rvm is setup to use for your project directory. The only place errors would show up is in the console. You can open that from |
Hi @HookyQR, |
It shouldn't be, the lack of output suggest to me that it's not finding the debugger rather than not finding rails. Try putting in a simple script in you base directory and running that with the debugger. If that doesn't run, then it's the debugger that isn't found, as I expect. You can point VS code to the debugger executable with a |
I tried adding the simple script and it works. So the debugger is definitely found. I do see something in the Output windows for the extension: "waiting for debug protocol on stdin/stdout". Nothing else. |
Can you please add |
The debug console shows now "Fast Debugger (ruby-debug-ide 0.6.1.beta2, debase 0.2.2.beta8, file filtering is supported) listens on 127.0.0.1:1234". But it terminates. |
That's the correct output. Add some output to your script, and see if that comes out on the debug console. ( |
@HookyQR debugging the script does work. It does hit my breakpoint and writes to the output window my puts "Hello world". |
By the way, thanks for helping out! |
Ok, so it's good that the script debug is working fully. (That confirms that it's not the debugger at all, sorry to put you through all that.) Can you check the file at Also, you can open VS Code's console from Help->Toggle Developer Tools, then open the console tab. Clear it before you launch the debug (if it's not all ready clear) and you may get some output there to help. |
Also, to check that everything would work correctly from a terminal with the same settings as VS Code is trying to run, open the internal terminal ( |
ok, so:
I found something interesting, if I add the "useBundler": true, option I start getting this error:
from /home/AMER/ggrasso/.rvm/gems/ruby-2.3.1@unisporkal/bin/ruby_executable_hooks:15:in eval' from /home/AMER/ggrasso/.rvm/gems/ruby-2.3.1@unisporkal/bin/ruby_executable_hooks:15:in '`
I tried adding the |
@germangrasso were you able to resolve this issue? |
For anyone else that runs into this problem (I hate it when there is a problem but never any solution offered), it is because VS Code is getting started outside of the terminal environment and rvm is being used to manage how to find the bits of Ruby. In order for the Ruby debugger to work under VS Code and cooperate with rvm, there are a number of environmental variables that need to be set.
There are probably a few of those that don't need to be created (specifically rvm_*), but that is what was showing up in my environment so I created them. My path could be adjusted some also. If I were to guess, I would say that only PATH, GEM_HOME, GEM_PATH and RUBY_VERSION only need to be put in the environment. Update: I was just able to confirm that the 4 variables above are the only ones really needing to be specified. |
I had a similar issue. The solution was instead of trying to update the path to rails, simply generate binstubs so the default path ${workspaceRoot}/bin/rails works. For our Rails 4 app that was $ rake rails:update:bin. For a Rails 5 app it may be different (possibly rails app:update:bin?) |
Deleting all breakpoints worked for me. |
vscode-ruby
version: 0.6.0I'm trying to run my rails app from VScode using the extension but I just can't.
I have this in my lauch.json:
Expected behavior
Rails server starts and I can browse my app.
Actual behavior
I'm only seeing the status bar blink in red once and this message in the Output console: "waiting for debug protocol on stdin/stdout"
Nothing else happens.
The program path seems to be correct because if I change it then there is an error in the debugger console because it can't find rails.
Is there a log that I can look at to see what's the underlying error?
Thanks,
German
The text was updated successfully, but these errors were encountered: