It’s a frikkin nightmare. Here’s how I did it:
c:\> gem install rails
this failed with an error message which said “‘make ‘ is not recognized as an internal or external command” whilst trying to build the native extensions.
The native extensions are things that Ruby needs to compile on your native system. It does this using make, the original tool on which rake, nant, powershell and other build tools are based on.
So I went off and downloaded make
(don’t forget to add the make bin directory to your path)
Next issue, make had an error “libintl3.dll could not be found”. Balls. Turns out make has some dependencies you also need to download… It’s a little further down the list after binaries and source.
"make: *** No rule to make target `/C/Ruby192/include/ruby-1.9.1/ruby.h'"
Balls. Balls. Balls.
Fix for this is to download the Ruby DevKit. Extract is and run the devkitvars.bat in the root of devkit, this adds loads of really useful stuff to your %PATH%.
Now try it again for the final time:
C:\RubyDevKit>gem install rails
Building native extensions. This could take a while...
Fetching: rdoc-3.12.gem (100%)
Depending on your version of ruby, you may need to install ruby rdoc/ri data:
<= 1.8.6 : unsupported
= 1.8.7 : gem install rdoc-data; rdoc-data --install
= 1.9.1 : gem install rdoc-data; rdoc-data --install
>= 1.9.2 : nothing to do! Yay!
Fetching: railties-3.2.0.gem (100%)
Fetching: rails-3.2.0.gem (100%)
Successfully installed json-1.6.5
Successfully installed rdoc-3.12
Successfully installed railties-3.2.0
Successfully installed rails-3.2.0
4 gems installed
Installing ri documentation for json-1.6.5...
Installing ri documentation for rdoc-3.12...
Installing ri documentation for railties-3.2.0...
Installing ri documentation for rails-3.2.0...
Installing RDoc documentation for json-1.6.5...
Installing RDoc documentation for rdoc-3.12...
Installing RDoc documentation for railties-3.2.0...
Installing RDoc documentation for rails-3.2.0...
and there was much rejoicing. YAAAY!
Now try to build a rails app:
c:\> rails new project_bob
C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.5/lib/bundler/ui.rb:56:in `': uninitialized constant Gem::SilentUI (NameError)
JUST FRIKKIN WORK DAMN YOU
after a bit of googling, turns out my bundler was out of date. So….
C:\>gem update bundler
Let’s try making that new Rails app again. Fingers, toes, knees, eyes… all crossed.
Now cd into the app you just created and try
c:\project_bob> rails c
Loading development environment (Rails 3.2.0)
GET IN. All done. Now time to do some work. Hope this helps some other unfortunate soul.