Help Setting up RubyMine with Cygwin Rails install

Spent hours on this so far.

Have Ruby installed successfully in Cygwin. Installed RM to try debugger and IDE features.

I used a basic, sample app that had bare functionality from the popular RoR tutorial here. App did nothing except show a couple of views.

All gems were fine with the app in cygwin, all dependencies worked fine. Here's my gem env:

$ gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.7
  - RUBY VERSION: 1.9.2 (2010-12-25 patchlevel 136) [i386-cygwin]
  - INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.9.1
  - RUBY EXECUTABLE: /usr/local/bin/ruby.exe
  - EXECUTABLE DIRECTORY: /usr/local/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-cygwin
  - GEM PATHS:
     - /usr/local/lib/ruby/gems/1.9.1
     - /home/cappy/.gem/ruby/1.9.1
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - :sources => ["http://rubygems.org/", "http://gems.github.com"]
  - REMOTE SOURCES:
     - http://rubygems.org/
     - http://gems.github.com



So I opened this project in a fresh install of RubyMine.

First, none of the gems that were installed in the project I imported were found to be attached. The IDE complained that many were missing and needed/wanted to install slews of them, usually several versions of each and most of which were not in my Gemfile. This was a silly sample app. Appears that there is some disconnect between the paths in cygwin and those in Windows?

I'd see a lot of errors in the idea.log like this after the IDE would take several minutes trying to install piles of gems.

2011-01-30 23:03:45,246 [ 756952]  ERROR - ns.plugins.ruby.gem.GemManager - Assertion failed: gem install internal error
sdk: Ruby SDK 1.9.2-p136
dependency: GemDependency{myName='syntax', myVersion='1.0.0', myBound=EQUAL, myUrl='', myLib='null'}
rootpath: file:///home/cappy/.gem/ruby/1.9.1/gems
gems:
broken root
specs:
broken specs
rootpath: file://D:/cygwin/usr/local/local/lib/ruby/gems/1.9.1/gems
gems:
broken root
specs:
broken specs
rootpath: file:///home/cappy/.gem/ruby/1.9.1/bundler/gems
gems:
broken root
specs:
broken specs
rootpath: file://D:/cygwin/usr/local/local/lib/ruby/gems/1.9.1/bundler/gems
gems:
broken root
specs:
broken specs



Note that I bolded 'local/local' above in that path. No idea where it is coming from. I have seen some threads here related to a 'HOME' environment variable set to '/home/user' on Windows, but this problem does not exist for me. There is no HOME environment variable set in Windows - but there is in Cygwin. I am launching RubyMine from Windows. I have verified this by running procexp on the RubyMine.exe process.

Also, the debugger won't work. First it said it was missing the required ruby-debug* gems. So I spent hours getting those working with a new, clean build of Ruby 1.9.2 in cygwin. All gems installed perfectly in cygwin, none in the IDE.

So, I cleared all caches (File | INvalidate Caches) did a gem clean in cygwin, deleted the project, and started over.

Now there are NO gems listed in the Gem Manager, and I have a message saying that the Rails gem isn't activated for my sample app. Can't attach any gems, can't run the server. Basically this thing is a big fat text editor at this point.

Incredibly frustrated.

This is a system running Windows 7 x64. All latest patches.
11 comments
Comment actions Permalink

I can only echo your frustration. RubyMine does not seem to support Cygwin.

I'm using RVM, which RubyMine claims to support; however, this support apparently does not extend to Windows. I'd be happy to point RubyMine at a specific Ruby implementation and gem directory. Unfortunately, selecting my ruby 1.9.2 installation seems to disable all the other options in the SDK window, including the Ruby version (which RubyMine for some reason insists is 1.8).

In particular, I can't add any gems or do any gem configuration.

I can open an existing Rails project, but since RubyMine can't see any of the Rails gems, there's not much I can do with it. I tried updating to the 3.1 beta, but that doesn't seem to make any difference.

$ gem environment
RubyGems Environment:
  - RUBYGEMS VERSION: 1.5.0
  - RUBY VERSION: 1.9.2 (2010-12-25 patchlevel 136) [i386-cygwin]
  - INSTALLATION DIRECTORY: /home/Garth/.rvm/gems/ruby-1.9.2-p136
  - RUBY EXECUTABLE: /home/Garth/.rvm/rubies/ruby-1.9.2-p136/bin/ruby.exe
  - EXECUTABLE DIRECTORY: /home/Garth/.rvm/gems/ruby-1.9.2-p136/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-cygwin
  - GEM PATHS:
     - /home/Garth/.rvm/gems/ruby-1.9.2-p136
     - /home/Garth/.rvm/gems/ruby-1.9.2-p136@global
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/



Attachment(s):
Capture.png
0
Comment actions Permalink

Hello  Garth,

In your case RubyMine isn't able to find gem executable on Cygwin+rubygems 1.5.0. I filed an bug reguest - http://youtrack.jetbrains.net/issue/RUBY-7777.

0
Comment actions Permalink

Hello Cappy,

RubyMine doesn't fully support Cygwin Ruby installation. On Windows RubyMine prefers and is tested with standard Ruby installation.

0
Comment actions Permalink

Thanks for the comments, Roman. It's good to have confirmation at least! :-)

This does seem a little strange - isn't the native Windows ruby a bit limited? (For example, doesn't it preclude you from using any gem with a compiled extension?) I would think that anyone doing serious development on Windows would be using Cygwin.

0
Comment actions Permalink

Hi Garth.

FWIW, I spent about six months developing under Windows and Cygwin until moving my development environment to Ubuntu (then finally Debian Lenny) virtual machine using VirtualBox. This was over a year ago and I've never looked back since!

Cygwin Ruby is SLOW - slower than native Windows Ruby (at least in my experience).

All the best

0
Comment actions Permalink

Ruby World in general don't like Windows guys ;), they prefer macs and linux. Cygwin support isn't fully implemented in RubyMine because we don't receive much feedback on Cygwin+Windows. All current Cygwin related bug/feature requests are fixed.

0
Comment actions Permalink

Agreed, Cygwin's ruby sure is slow... So far, I've been doing my Rails development on a Solaris Express 11 server (which is itself a pretty poor ruby platform, for a variety of reasons) using a VPN client. I'm actually pretty familiar with Ubuntu and like it a lot - I just don't want to run it as my primary desktop OS.  I was hoping to break out of the virtual box prison with RubyMine, but I guess it's time to give VirtualBox a shot.

Just for the record, Cygwin does seem to run pretty much everything I need, including RVM and quite a few gems with compiled extensions. The only real issue for me is the speed.

Thanks for the comments - the feedback is much appreciated!

0
Comment actions Permalink

RVM with Cygwin is working just fine for me also, its unfortunately RubyMine that is the problem :/. All the same files you used in Linux/OSX to find the RVM setup are there, can't you just look for them in cygwin also? Or at the very lets us manually indicate the gems directory?

0
Comment actions Permalink

McNaz wrote:

FWIW, I spent about six months developing under Windows and Cygwin until moving my development environment to Ubuntu (then finally Debian Lenny) virtual machine using VirtualBox. This was over a year ago and I've never looked back since!



Are you running RubyMine inside the VirtualBox also then?

I'm wondering if its possible to run RubyMine in Windows then use ssh to run its commands on the VirtualBox instance (or really any Linux device). Since RM seems to do everything through stdout/in redirects anyway it should be possible. I would then just map the folder over as well for editing.

d

0
Comment actions Permalink

>Are you running RubyMine inside the VirtualBox also then?

Yes. I've setup a minimal Debian 6 install on VirtualBox running XFCE 4.6.2. The debian OS + Window Manager takes up about 60-70MB overhead, leaving the rest for the Ruby interpreter plus the JVM. The VM's RAM is set to 768MB and I've given it 10GB of disk space.

RM runs fine under linux provided you install Sun/Oracle JRE 6.x - not OpenJDK as that has issues.

I tend to run Chrome on Windows, which I point to the VM's IP address. This works well for me as Windows manages my second monitor (which has Chrome) and the main monitor houses my fullscreen Linux VM.

I prefer this setup as GIT has much less trouble running natively under Linux. Its also much simpler compiling native GEMs.

HTH

0
Comment actions Permalink

reesd wrote:

McNaz wrote:

FWIW, I spent about six months developing under Windows and Cygwin until moving my development environment to Ubuntu (then finally Debian Lenny) virtual machine using VirtualBox. This was over a year ago and I've never looked back since!



Are you running RubyMine inside the VirtualBox also then?

I'm wondering if its possible to run RubyMine in Windows then use ssh to run its commands on the VirtualBox instance (or really any Linux device). Since RM seems to do everything through stdout/in redirects anyway it should be possible. I would then just map the folder over as well for editing.

d


I found out that PyCharm actually has this for Python (they call it "remote interpreter") so I created youtrack feature requests for it for both ruby and node:
http://youtrack.jetbrains.com/issue/RUBY-11085
http://youtrack.jetbrains.com/issue/WI-11290

d

0

Please sign in to leave a comment.