Sw33tCode

Smart code for developers

Sw33tCode header image 2

Installing Ruby on Rails with Lovdbyless on a Windows machine

April 13th, 2008 · 14 Comments


I know a lot of people who use ruby are either doing their development on linux machines or macs, but for those people who are brave….. here is a guide for you setting up LovdByLess with Ruby on Rails on Windows machine. The machine I used is Windows XP.

LovdByLess is built with Ruby on Rails and is a social networking solution that has everything you need to build your community.
The folowing installation of Ruby and Ruby on Rails was created with guidance from the RubyOnRails.org documentation which can be found here.

Install Ruby compiler
For Windows I used the One-Click Installer – Windows found here: rubyforge.org(Which for me at the time of this post was version ruby186-26)

I like to be able to run ruby from where ever I am in the command prompt so in order to do that just add this line (if not there already) to your Path variable in the System Variables:
c:\ruby\bin;

Setup RubyGems and Rails on Ruby
Download from here rubyforge.org the latest release of Ruby gems. I used the zip version 1.1.0 for this installation. Extract the zip file to where ever you want. Open a console (cmd.exe) window and proceed to where you extracted the rubygems 1.1.0. Run this command:
c:\[rubygems 1.1.0 Path]\ ruby setup.rb

Now we want to setup Rails. Just type this in the command prompt:
gem install rails --include-dependencies

Download and extract the zip file from LOVDbyLESS.

We have to install the following gems using the RubyGems program we just installed. From the command prompt, run the following:
c:\gem install youtube-g
c:\gem install rflickr
c:\gem install uuidtools
c:\gem install colored
c:\gem install hpricot
c:\gem install mocha
c:\gem install redgreen
c:\gem install RedCloth
c:\gem install acts_as_ferret
c:\gem install ferret
c:\gem install win32console
c:\gem install avatar
c:\gem install tzinfo
c:\gem install rails

****If you get asked during these gem installations to Install hoe, rubyforge, Rake, mime-types, xml-simple, etc just type Yes for these.****

Get rmagick gem here, download and extract. Execute:
ImageMagick-6.3.7-8-Q8-windows-dll.exe
In the console change directory to where you extracted the gem.
gem install rmagick-2.0.0-x86-mswin32
This will require a reboot of your machine at some point before you try to use this gem. (Trust me. this took me a long time to figure out!)

We need to create a mysql user account to run the LovdByLess database with. This assumes you have Mysql running on your machine. From the command prompt type and hit enter:
mysql --user=root mysql -p
Enter your password. Create mysql user:
GRANT ALL PRIVILEGES ON *.* TO 'lovdbyless'@'%'
IDENTIFIED BY 'my_password' WITH GRANT OPTION;

Then exit mysql:
quit mysql

Go to the directory where you extracted LovdByLess and open the config folder. Copy database.yml.tmp to database.yml. Edit this file and replace the values for username and password with the mysql user you created above.

From the command prompt, proceed to your LovdByLess directory, run the following:
rake db:create:all
rake db:migrate a=no
rake

The last command should run all ruby tests for the project. Now run this from your lovdbyless folder in the command console:
ruby script\server
The rails server is now up and running. Open up a web browser and go to this address:
http://localhost:3000/

Please let me know if you had any issues setting this up. Thanks!

Tags: Mysql · Ruby · Ruby On Rails

14 responses so far ↓

  • 1 Michael // Jul 13, 2008 at 6:59 pm

    Thanks for the guide.

    Did you have any problems with ferret and acts_as_ferret?

    Per the README in the LovdByLess zip, I installed ferret manually in Win Vista. (I tried using gem remote, but it failed with a nmake error.)

    However, I am still getting messages saying they need to be installed, then the assertions fails on the final ‘rake’.

    I’m a RoR noob, so feel free to just point me in the general direction if that’s easier.

    Regards,
    Mike

  • 2 Michael // Jul 13, 2008 at 7:05 pm

    Also, any thoughts on why not to migrate to a Mac other than $$$ for Ruby Dev?

    I’m a Win developer, and I’m worried about struggling with Ruby on Rails on a Windows box.

    -Mike

  • 3 KevBurnsJr // Aug 22, 2008 at 1:29 pm

    Nice!
    You just saved me a lot of time and headache.

    Great finisher for Gamut’s writeup.
    http://www.gamutworks.net/blog/?p=17#comment-18

    I would drop you each $5 if you had a donate button.

  • 4 Thomas Wheeler // Aug 23, 2008 at 12:30 pm

    Hi Michael. I’m not entirely sure why it won’t install on Vista properly with ferret. But this link might help you out:
    http://www.gamutworks.net/blog/?p=17#comment-18

  • 5 Thomas Wheeler // Aug 23, 2008 at 12:35 pm

    KevBurnsJr thx for the feedback. Appreciate it. I would put a donate button up but I haven’t done much in the past few months on my blog. I need to start get moving on this again I have cool articles I want to write on WCF (.net) and MVC that I think others would like.
    TW

  • 6 ok // Sep 25, 2008 at 2:56 am

    good site jlfpch

  • 7 Ben // Apr 21, 2009 at 1:47 pm

    I keep getting MySQL errors,
    “ruby interpreter (cui) i.8.6 has stopped working”
    and a [BUG] Segmentation fault in the command prompt

  • 8 Thomas Wheeler // Apr 21, 2009 at 3:04 pm

    Hi Ben,

    Are you by chance using Mysql 5.1 and running on Vista??

    Check out this link:
    http://railsforum.com/viewtopic.php?id=26823

    I never ran into this problem but I do have Mysql 5.045. I don’t know why Mysql 5.1 is causing this problem. :(

  • 9 chacha // May 7, 2009 at 6:05 am

    Hi. So much for the guide everything was okay but then when I ran ruby script\server I got this following errors:

    C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in ‘require’: Interrupt

    and the rest were all errors I am trying to figure it out but it seems that it just makes the matters worst. Please your help is really really mcuh appreciated.

    Love Lost,

    Lot-lot

  • 10 Jinho Park // May 7, 2009 at 8:32 pm

    Hi Ben, I had same problem but I downloaded PHP installation package and copied libmysql.dll to c:/Ruby/bin…and worked fine.

    And for Micheal, when you install ferret gem it complains about nmake, do this : 1) download windows SDK, 2) change the MSC_VER to 1400 in c:\ruby\lib\ruby\1.8\i386-mswin32\config.h

    Good luck.

  • 11 Thomas Wheeler // May 8, 2009 at 11:58 am

    Hi chacha. I never got that error when I did this but I did a little bit of research and noticed this post that might be helpful to you:

    http://ruby-on-rails2.blogspot.com/2009_04_01_archive.html

    There’s a guy that posted a comment on this thread that seems to have the same problem as you and a few people on there had suggestions. Check it out.

  • 12 Cheaxange // May 24, 2009 at 8:46 am

    Hi, courteous posts there :-) hold responsible’s concerning the intriguing advice

  • 13 KrisBelucci // Jun 2, 2009 at 4:16 pm

    Hi, good post. I have been wondering about this issue,so thanks for posting. I’ll definitely be coming back to your site.

  • 14 KrisBelucci // Jun 2, 2009 at 6:13 pm

    I really liked this post. Can I copy it to my site? Thank you in advance.

Leave a Comment

*