Before playing with rails, you have some prerequisites. You need the ruby engine, a DevKit to let you compile native extension and the rails gem.
I will show you how to install all of them on windows. It’s a lot easier on Linux ! (apt-get install ruby && gem install rails)
- Grab the latest installer 32 or 64 bit, install it on C:\Ruby
- Download the DevKit too, if you don’t have MinGW installed on your computer, take the MinGW included auto extractor 32 or 64 bit. Extract it on C:\DevKit
As said on the DevKit wiki page, you need to type two commands after DevKit download to install it completely.
Open a new command prompt and type:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
C:\>cd C:\DevKit C:\DevKit>ruby dk.rb init [INFO] found RubyInstaller v2.0.0 at C:/Ruby200-x64 Initialization complete! Please review and modify the auto-generated 'config.yml' file to ensure it contains the root directories to all of the installed Rubies you want enhanced by the DevKit. C:\DevKit>ruby dk.rb install [INFO] Updating convenience notice gem override for 'C:/Ruby200-x64' [INFO] Installing 'C:/Ruby200-x64/lib/ruby/site_ruby/devkit.rb' |
You just installed correctly your Ruby environment. But rails isn’t installed yet. You could install it with a windows installer but it’s much easier by using the gem installer system. Normally you should have the ruby command in your Windows path, this command should work anywhere:
1 2 3 4 5 6 7 8 9 |
C:\>gem install rails Fetching: i18n-0.6.1.gem (100%) Successfully installed i18n-0.6.1 Fetching: multi_json-1.6.1.gem (100%) Successfully installed multi_json-1.6.1 ...etc... 29 gems installed |
You should have rails correctly installed in your path and its command accessible from everywhere.
If not, add manually your Ruby bin directory c:\Ruby200-x64\bin to your PATH
Rails environment installed !
If you want to remove by default all doc install with each gem, just type:
1 |
echo "gem: --no-rdoc --no-ri" >> /etc/gemrc |
For Windows :
1 |
(echo install: --no-document && echo update: --no-document) >> c:\ProgramData\gemrc |
Recent Comments