Garbage Burrito

Rails Development Environment Under Cygwin

Rails Development Environment Under Cygwin
Ben Kittrell - 12/22/2006 00:09:00
Comments: 5
Last Comment: 01/30/2008 15:41:22

Guess what?  I like Windows.  So sue me.

However DOS sucks, and I need a good CLI.  After finding Console I was feeling better, but I still needed the power of *nix command line tools.  I usually have a copy of cygwin installed, but I've never dived into it and used it as a development environment.

So I set out to get a functional Rails development environment, and it wasn't too easy, but I made it out alive.  Here's what I did in a Nutshell.

Installed Cygwin with
    ruby
    subversion
    ssh
    libopenssl-devel
    vim
    
Then you'll need gems, so download the tgz here.  Before you install it you'll need to run the following command, else you'll get an error.

$ unset RUBYOPT


After that unzip the gems package and run the setup script.  

Then I installed my gems for rails, capistrano, and rails machine.

$ gem install rails --include-dependencies
$ gem install gem_plugin daemons capistrano --include-dependencies
$ gem install mongrel mongrel_cluster railsmachine --include-dependencies


That went smoothly.  After that I had a problem where it was using the Windows version of Subversion, instead of the cygwin one.  So I changed my PATH in .bash_profile and took out all the windows paths.  After that I was able to run cap commands.

Then I needed RMagick, so I had to install ImageMagick first.  I re-ran cygwin setup and installed the following packages.  I actually didn't install them all at once.  It was through a series of trial and error while installing RMagick.

    g++
    gcc
    ImageMagick
    libmagick-devel
    XFree86-lib-compat
    xorg-x11-devel
    libbz2-devel

Then install rmagick from the gem.

I figured I might as well keep the windows version of Mysql, but when I ran my tests I could an error saying it couldn't find /tmp/mysql.sock.  After some searching I found out that you can fix this by changing 'localhost' to '127.0.0.1' in your config.

Finally, once my tests got to the RMagick stuff, I got some remap error or something.  Again to google and I found out that I needed to install 'rebase' and run this command from DOS, with all cygwin instances closed.

> ash rebaseall

That wasn't so bad really.  Now I have a fully functional Rails environment running under cygwin! 

BTW, I didn't write down the websites that help me along the way, sorry guys. 

Comments: 5
Last Comment: 01/30/2008 15:41:22

Comments

1. Kevin Bowen  |  my website   |   03/16/2007 02:21:58

Nice summary. I appreciate you taking the time to document the required packages for Rmagick. I've had a ruby on rails development running, via cygwin, for some time now, and was stumped on getting this particluar gem to install. Thanks.

2. sinclair   |   03/28/2007 12:39:34

Hey, like Kevin thanks for that old rMagick !

Hit that hump today.

Cheers!
sinclair

3. Jesper Rønn-Jensen (justaddwater.dk)  |  my website   |   05/15/2007 05:51:46

Thought I would mention that there are som extra tips mentioned in this forum thread for <a href="web link up a cygwin environment</a>

4. Dave   |   06/09/2007 01:57:36

What mail program could you use for ActiveMailer with this type of setup? How would it be configured in the environment.rb file?

5. marcel   |   01/30/2008 15:41:22

I get the same "/tmp/mysql.sock" problem. What config file do I edit???

I'm "upgrading" from the regular windows console setup, so maybe something is getting in the way?

Post a Comment


Are you human? Please enter the word below.
M3nhaw50lmpwzzeynjgzntkzmjm=


powered by Doodlekit™ Free Website Builder by Doodlebit™ Website Company