2

I've just installed my Windows setup for working on Ruby on Rails through RailsInstaller. On the Windows command line it all works well. I'm also using cygwin, which install by default its own version of ruby. That doesn't work along well with C-extension gems like bcrypt-ruby. the RailsInstaller version of ruby doesn't have a problem though.

Where I do get an issue is when I try to install unix-specific gems like unicorn on windows. It won't go. This should work on cygwin. So I'm in a conundrum. I've uninstalled the cygwin ruby. But now I can't run the other ruby, rubygems or rake inside cygwin. It spits out the following lovely message:

 C:\RailsInstaller\Ruby1.9.3\bin\ruby.exe: No such file or directory -- 
 /cygdrive/c/RailsInstaller/Ruby1.9.3/bin/bundle (LoadError)

Hope some of you could work around the issue.

ChuckE
  • 5,610
  • 4
  • 31
  • 59

2 Answers2

4

Cygwin Ports provides Rails for Cygwin's Ruby; choose the ruby-rails package and allow all dependencies to be installed.

Yaakov
  • 1,705
  • 10
  • 10
  • Nice one, it did install the gems where the extensions were failing to compile, like bcrypt-ruby and unicorn. I'm having just trouble binding the local gems with my project bundle. I'm running install and it's trying to download and install the gems all over again, and failing as expected. What's the best strategy for the project bundle to recognize and use the local ruby gems that the cygwin installer installed? – ChuckE Jul 08 '13 at 06:59
  • First, make sure you are using _Cygwin's_ `/usr/bin/ruby`. Then for a new Rails app, run `rails new [directory] --skip-bundle`, and inside the app directory, `bundle install --local`. Repeat the last step anytime a gem is updated in the distro or Ports. – Yaakov Jul 09 '13 at 03:57
0

Yaakov was close, it is indeed easier to just install everything into cygwin, including the C-extension gems (or most of them). The problem remains though, everytime there is an update on one of those gems. Actually the solution was installing the devel make packages that were missing from my cygwin. After that I finally could compile and proceed.

ChuckE
  • 5,610
  • 4
  • 31
  • 59