Remote sdk with Vagrant

Hey,
Setup: Windows 7, vagrant with ubuntu, ruby mine 5.4.3.2.1
So I just installed ruby 2 on my vagrant and wanted to import the sdk. First I got an error message that it cannot copy thin. Then when I tried again I got this:

"Unknown message with code "Could not determine the type of file "sftp://127.0.0.1:2222/home/vagrant/.rubymine_helpers"."."

I tried deleting them, but it didn't help, they appeared again next time. Any ideas? Has anyone ever managed to get the remote debugging working on windows with vagrant?

Thanks!
Nikolay

8 comments
Comment actions Permalink

Similar combination worked fine for me (now I'm on Windows 8 and it also works).
How have you install ruby?  In what location?  Also it could be helpful to see RM's log (Help|Show Log in...), please attach it.

Regards, Oleg.

0
Comment actions Permalink

Hey Oleg,
I downloaded the ruby source, then ran: ./configure, make, make install. It was installed in /usr/local/bin/ruby.
Attaching the log file from today



Attachment(s):
idea.log.1.zip
0
Comment actions Permalink

Attached is the error message that I originally got when I tried to add the remote sdk.
Also attached is the error log.



Attachment(s):
rubymine_vagrant_error.png
idea.log.zip
0
Comment actions Permalink

The only problem I see is "Could not connect to SFTP server at "sftp://127.0.0.1:2222/"" which is caused by "channel is not opened." :(
It looks like you have some problems with connection to VM (or we use stale connection ;)
I'd suggest to restart VM and RM and try one more time.  Also I'd check if some firewall or other programm blocks such connection and (as last resort) I'd check logs on VM to see
if they suggest the reason why connection can be closed.

Hope this helps, Oleg.

P.S. also you could try our RM 6.0 Beta to check if the problem reproducible there.

0
Comment actions Permalink

In the second log I also see permission denied.  This might be the reason why RM was unable to copy data from remote sdk.

Oleg.

0
Comment actions Permalink

Hey Oleg,
I saw the permission denied errors as well, so I tried the following - when adding a remote SDK I used the root user instead of vagrant, and it successfully uploaded all the gems. However when I tried running the app from RubyMine I got the following error:

/usr/local/bin/ruby /root/.rubymine_helpers/rb/exec_with_work_dir.rb "F:/projects/gomama" /usr/local/bin/ruby -e '$stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)' "F:/projects/gomama/bin/rails" server -b 127.0.0.1 -p 3000 -e development
/root/.rubymine_helpers/rb/exec_with_work_dir.rb:6:in `chdir': No such file or directory - F:/projects/gomama (Errno::ENOENT)
 from /root/.rubymine_helpers/rb/exec_with_work_dir.rb:6:in `<main>'

Maybe the system is not supposed to run with the root user. Nonetheless we have verified that the previous error is a permission issue, I'm not a Linux expert so I'd appreciate your advice  on how to change the permissions so that I can get the SDK with the vagrant user.

Thanks!
Nikolay

0
Comment actions Permalink

Hi Nikolay,

it looks like you have not configured deployent settings (especially mappings) here are a short tutorial about configuring remote sdk it shows how to do this and other stuff you may need (http://confluence.jetbrains.com/display/RUBYDEV/Configuring+Remote+Interpreters)
As for changing permission: you can use chown and chmod for this but I'd suggest to reinstall ruby to the directory which is accessible for vagrant (and do not use sudo during installation) for this you need to rebuild ruby with appropriate prefix.
Another way to get ruby installed is to use rbenv for this (but please use ruby under .rbenv/versions when you will create remote sdk)

Regards, Oleg.

0
Comment actions Permalink

Hey Oleg,
I did as you suggested, setup the mapping and then it all worked.
Then I installed rbenv  and RubyMine was able to successfully import the sdk with the vagrant user.
Thanks for the support!

P.S. maybe in your setup tutorials, advice users to use rbenv and not use rvm :)

RubyMine rules!
Regards,
Nikolay

0

Please sign in to leave a comment.