Some blogs says Windows is not a right platform to start Learning Ruby, maybe it’s right, but anyway, I just successfully install the latest Ruby&Rails web stack following below steps:
- Install RailsInstaller as a whole exe (56.6MB), if you want to access that file in China, please use this link instead, you may have to register 115 account first. After install, For C:\RailsInstaller\scripts\config_check.rb, you need to change:
- gem source -r https://rubygems.org/ # if you have VPN, you can skip step 2 & 3
- gem source -a https://gems.ruby-china.com/
- gem update ––system
- gem update
- gem install win32console #enable colorize_logging in windows
- gem install vmc #if plan to deploy your rails application in Cloud Foundry
- gem install ruby-oci8 #if plan to deploy your rails application in Oracle DB)
- gem install activerecord-oracle_enhanced-adapter #if plan to deploy your rails application in Oracle DB
- gem install pry #an IRB alternative and runtime developer console
- gem install pry-doc
- gem install mongoid
- gem install bson_ext
- gem install linecache19 #below three line is need if you want to debug with RubyMine
- gem install ruby-debug-ide
- gem install ruby-debug-base19-0.11.26.gem – –with-ruby-include=“C:\RailsInstaller\Ruby1.9.3\include\ruby-1.9.1\ruby-1.9.3-p125”
- gem install specific_install
- gem specific_install -l http://github.com/eventmachine/eventmachine.git # build eventmachine or use below to install a precompile version
- gem install eventmachine –pre # version eventmachine-1.0.0.rc.4-x86-mingw32.gem works in Windows 7
- gem install thin # new version 1.4.1 need add gem ‘thin’ in Gemfile to work successfully
- gem clean (clean some outdated gems during above installation, say n if any depend warning)
:home => File.join( ENV[“HOMEDRIVE”], ENV[“HOMEPATH”] ), :ssh_path => File.join( ENV[“HOMEDRIVE”], ENV[“HOMEPATH”], “.ssh” ), :ssh_key => File.join( ENV[“HOMEDRIVE”], ENV[“HOMEPATH”], “.ssh”, “id_rsa”), :ssh_pub_key => File.join( ENV[“HOMEDRIVE”], ENV[“HOMEPATH”], “.ssh”, “id_rsa.pub”),Into:
:home => ENV[“HOME”], :ssh_path => File.join( ENV[“HOME”], “.ssh” ), :ssh_key => File.join( ENV[“HOME”], “.ssh”, “id_rsa”), :ssh_pub_key => File.join( ENV[“HOME”], “.ssh”, “id_rsa.pub”),And create %HOME% environment in System Properties->Advanced->Environment Variables and REM the SET HOME=%HOMEDRIVE%%HOMEPATH% in c:\RailsInstaller\Ruby1.9.3\setup_environment.bat, then you should be able to run “Command Prompt with Ruby and Rails”
After install and if you already install Git in “C:\Program Files\Git” like me, you can delete the Git folder “C:\RailsInstaller\Git” installed by RailsInstaller and make a Junction link to your existing one (need in the administrator cmd prompt) to save 250+ MB hard drive.
C:\windows\system32>mklink /J C:\RailsInstaller\Git “C:\Program Files\Git” Junction created for C:\RailsInstaller\Git <<===>> C:\Program Files\GitYou can also edit the file “C:\RailsInstaller\Ruby1.9.3\lib\ruby\1.9.1\webrick\httpresponse.rb”, line 205 and add red part to avoid very annoying warning.
|