views:

321

answers:

7

I am beginner of Ruby on Rails and use Windows for development.

I do the following steps:
1. Download Ruby v.1.9.1
ftp://ftp.ruby-lang.org/pub/ruby/binaries/mswin32/ruby-1.9.1-p0-i386-mswin32.zip Extract it and put it into C:\ruby
2. Download the latest Aptana and install it
3. Install the RadRail plugin in Aptana.
4. Set the ruby path to C:\ruby

After that, it warns me about I do not install RubyGems. I know that Ruby v.1.9.1 already includes RubyGems.

What should I do now to get it work?

A: 

In the Ruby on Rails download page they say you should download RubyGems too, so maybe you could try that.

I don't know if the Windows version of Ruby ships with RubyGems but you won't lose anything if you try.

apalankat
ruby setup.rbIt can't find the ruby executable.
Billy
If you can't find the Ruby executable, then you haven't properly added Ruby to your path (step 4). Make sure it's really on your path by typing "ruby -v". Also, Aptana is kind of crashy -- I'd recommend NetBeans instead.
John Feminella
+1  A: 

Well, step one is to get the right version of Ruby for Rails. Ruby 1.9.1 causes odd issues in Rails. Uninstall it and get 1.8.7 instead.

Sarah Mei
A: 

I've been trying to install ruby 1.9.1, but when I try to setup gems (I think they are not included) I get an error about not find zlib.dll... has anybody else had the same issue???

opensas
+1  A: 

If you are a beginner using Windows, I would suggest taking the easiest possible route and installing a Ruby and Rails distribution made by someone else, e.g.

The Ruby edition of Netbeans incorporates it's own Ruby runtime (JRuby), so is very good for getting started quickly.

The official Ruby downloads are intended for people who are comfortable installing dependencies and compiling their own versions. On most operating systems you can just use the version of Ruby supplied by the vendor. Microsoft don't provide a Ruby build, and compiling it is also more difficult on Windows, where you have to install a compiler, download copies of Zlib and OpenSSL etc.

Stuart Ellis
A: 

The steps for installing Rails on MS Windows is presented here. Installing Rails on Windows

Rajeshwaran S P
A: 

Aptana doesn't support 1.9.1 yet from what I have read.

OutOFTouch
+1  A: 

Preface: This answer is obviously way too late to help Billy, but this is a common problem area for people starting up with RoR on Windows and something I repeatedly had trouble with. So...

The first issue is with Step 1. Downloading and extracting the Ruby package is not enough to get a working Ruby environment, as Ruby depends on library support from the OS that doesn't exist in Windows. So you'll need to download and install (essentially, just copy them into the \ruby\bin folder) several DLL files that provide this support. Here's a very clear blog post that covers this install ruby 1.9 on Windows.

You then need to add "c:\ruby\bin" to your windows PATH (obviously modifying that if you installed to a different folder).

Now you can run ruby -v and gem -v to check that Ruby is working properly. If you get error messages then you know that something is missing or the PATH is wrong.

An easier alternative is the one-click ruby installer. Unfortunately the old version which ruby-lang.org link to is only for Ruby 1.8.6 and is no longer being updated. There's a new RubyInstaller project team who have a "technology preview" one-click installer for Ruby 1.9.1. Clearly it's still under development, but it works well for me.

Once you have Ruby installed and working you need to install Rails.

Before you start run gem update --system to update Rubygems to the latest version. Just in case.

Rails (by default) uses the SQLite database for development. You can download the pre-compiled SQLite libraries from the sqlite.org downloads page, and you should extract the zipped sqlite3.dll and sqlite3.def files into \Ruby\bin (or anywhere else on your Windows PATH). You should then run gem install sqlite3-ruby to install the Ruby SQLite driver.

And now you can run gem install rails to actually install rails. Expect this to take a minute or two.

Finally, note that the Ruby and Rails environment is constantly changing. And unfortunately compatibility problems are a regular issue for Windows users (for example a few months back it was impossible to get hold of a Ruby 1.9 compatible version of the sqlite3-ruby gem that would compile in Windows). It's quite likely that installation guides that were accurate at the time will be out of date within a few months. So check the date of this post before assuming everything written here is still true!

Mark Weston