Search code examples
ruby-on-railsrubymacosrubymine

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.


Solution

  • 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