Guj Mil
Guj Mil

Reputation: 345

RubyMine on Windows with rails code on OS X server

This is a weird question, so bear with me while I try to explain it properly.

I have a Ruby on Rails app running on Heroku, with source code on Git. In my home, I have a Mac small laptop, and a Windows 7 Desktop PC.

What I want is to be able to work the code on RubyMine on my Windows machine. Because of many many shenanigans, working on Windows and then uploading to heroku just doesn't work.

Instead, I would like to download my code on my Mac, open it somehow from Windows (on LAN), and be able to run it on the Mac (from RubyMine on Windows), and open it in a browser from Windows.

I've been trying for several weeks now. Have anyone done this before? I know it sounds bizarre, but I really wish to work on my 3 monitors Windows setup.

Upvotes: 0

Views: 76

Answers (2)

3limin4t0r
3limin4t0r

Reputation: 21110

You can let RubyMine use an SDK over SSH.

  1. go to: File => Settings
  2. select: Languages & Frameworks => Ruby SDK and gems
  3. click the add icon (plus symbol)
  4. choose: New remote...
  5. select: SSH Credentials
  6. fill in the host, username, password and path

After adding the remote SDK make sure it is selected as your project SDK.

edit

As @GujMil pointed out in the comments below, when running the application the Windows path is send as parameter to the Ruby SDK. After some fiddling I found that you can map the local path to the remote path in the SDK Configuration or Run/Debug Configurations.

  1. go back to the SDK configuration (step 1 & 2 previous list)
  2. click the Edit Path Mappings icon for your remote Ruby SDK (img)
  3. add your path maps

For me the following was enough (using Linux instead of OS X):

+----------------+-------------+
| Local path     | Remote path |
+----------------+-------------+
| //192.168.0.96 | /home       |
+----------------+-------------+

For further info see: https://www.jetbrains.com/help/ruby/configuring-remote-interpreters-via-ssh.html

Upvotes: 1

Reuben Mallaby
Reuben Mallaby

Reputation: 5767

If your question sounds bizarre, so does my answer. I have experimented a similar setup with Linux servers.

  1. Set up a shared folder to host the code on the Mac: Apple instructions here

  2. Access the folder over your LAN and edit the code in RubyMine.

  3. Open an SSH terminal to your Mac so that you can remotely run the Rails server, run necessary commands and view the logs (easy with your multi-monitor setup)

Note: RubyMine will likely complain about missing gems.

Upvotes: 0

Related Questions