install ruby on rails

-1. build ruby in ubuntu
http://stackoverflow.com/questions/18490591/how-to-install-ruby-2-on-ubuntu-without-rvm

0. environment
Windows 7 sp1 64bit

1. install ruby

latest version for windows, 2.0.0-p481 x64
http://rubyinstaller.org/downloads/

support that installer folder: c:\ruby
add to path: set path=%path%;c:\ruby

2. install devkit

same site as pervious, http://rubyinstaller.org/downloads/
DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe

extract to somewhere, e.g. c:\devkit
run: ruby dk.rb init
will generate config.yml, open the file, find the ruby installation dir, if it is not existing or commented out, add " - c:/ruby"
NOTICE: the space before and after -.

run: ruby dk.rb install

3. install rails

suppose the installation dir is c:\ruby
run: gem install rails

4. create application

support that new application dir is c:\newapp
run: rails new c:\newapp
run: cd /d c:\newapp
run: rails server
if server starts successfully, step 5/6 can be ignored.
open browser, navigate to http://localhost:3000 to see the welcome page.

5. update gemfile

if you face this error "TZInfo::DataSourceNotFound"
open c:\newapp\gemfile
find following lines, if there is not or not the same, add to the gemfile

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw]

run: bundle update

6. start server

posted @ 2014-06-06 18:09  sadcat  阅读(178)  评论(0编辑  收藏  举报