Where to start
Of course, here: http://rubyonrails.org/download.How to install Ruby
Follow the link from the Where to start section and install latest version of Ruby. The current version is 1.9.3 therefore you should use the rubyinstaller-1.9.3-p0.exe link. Install the application as usual. The first trap comes here. Check all the three boxes on the first screen (for some reason these are unchecked by default):You can ensure the Ruby is installed correctly by opening PowerShell and type in "irb". If you see irb(main):001> you are in.
How to install Ruby Gems
Ruby Gems is something like a package manager. It is needed for Ruby on Rails installation. Follow the link from Where to start section and download the package (ZIP in my case). Unpack the package and run the setup.rb script. The .rb was registered during Ruby installation.How to install Ruby On Rails
Open PowerShell and type in gem install rails. You will see something like this:I have seen one error: file lib not found. What does it mean? I'm not sure but you can continue in instructions.
Make your application
Open PowerShell and type in (every line is a single command):rails new path/to/your/new/application
cd path/to/your/new/application
rails server
You can use PowerShell for that.
Ouch. Trap number two!
I've got this message:
Gem::InstallError: The 'json' native gem requires installed build tools.
Please update your PATH to include build tools or download the DevKit
from 'http://rubyinstaller.org/downloads' and follow the instructions
at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'
An error occured while installing json (1.6.5), and Bundler cannot continue.
Make sure that `gem install json -v '1.6.5'` succeeds before bundling.
I've tried to install json this way: gem install json and I've got another error:
ERROR: Error installing json:
The 'json' native gem requires installed build tools.
Please update your PATH to include build tools or download the DevKit
from 'http://rubyinstaller.org/downloads' and follow the instructions
at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'
How to install Development Kit
From Ruby installers download the file DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe. Create a folder DevKit inside Ruby folder and unpack the downloaded package into this newly created folder. Then run:devktivars.ps1
ruby dk.rb install
Now you can finally run command: gem install json.
How to install Ruby on Rails again
You know:rails new path/to/your/new/application
cd path/to/your/new/application
rails server
Run server
http://localhost:3000If you can see this screen:
that means you have succesfully configured Ruby on Rail in Windows!




0 comments:
Post a Comment