Monthly Archives: August 2014

2014 Complete Guide to Installing Ruby 2.0 and Rails 4.1 on Windows

If you are trying to dive head first into web development and don’t know where to start… STOP. Ruby on Rails is an excellent fun way to learn that will show you how to use the MVC architecture. Now there can be no excuses because here are the instructions on how to install Ruby 2.0 using your Windows machine.

THIS GUIDE IS INTENDED TO FACILITATE THE FORKING OF THE STREAMLINERS PROJECT https://github.com/rsaez/streamliners BUT CAN BE USED BY ALL.

INSTALLING RUBY AND THE RAILS GEM

1. Download and install Ruby 2.0 from (http://rubyinstaller.org/downloads/)

2. Download the corresponding development kit from (http://rubyinstaller.org/downloads/)
a. Extract it to a permanent directory, for example say “C:/Ruby200/devkit”

3. Open a command prompt, change directory to “C:/Ruby200/devkit”, and type the command “ruby dk.rb init”
a. This creates the file “config.yml”, be sure it has the directory that holds ruby, the last line   should be: “- C:/Ruby200”.

4. At the command prompt, the next command is “ruby dk.rb install”

5. At the command prompt, the next command is “gem install rails”

Now you have the Ruby language installed along with the Rails gem. Next install SQLite3

SQLITE3(from http://rubyonwindowsguides.github.io/book/ch02-05.html)

1. Download SQLite source code from http://sqlite.org/2014/sqlite-autoconf-3080600.tar.gz

2. Extract to C:\ruby200\devkit\sqlite-autoconf-3080600

3. Add devkit to the path
  a. At cmd prompt, cd to C:\ruby200\devkit\sqlite-autoconf-3080600
  b. type the command “c:\ruby200\devkit\devkitvars.bat”

4. Start a MSYS shell
  a. At cmd prompt C:\ruby200\devkit\sqlite-autoconf-3080600> sh

5. Configure SQLite3
  a. At MSYS shell sh-3.1$ ./configure CFLAGS=”-DSQLITE_ENABLE_COLUMN_METADATA”

6. Build SQLite3
  a. sh-3.1$ make

7. Let us build the SQLite GEM
  a. Go to SQLite gem directory C:\ruby200\lib\gems\2.0.0\gems\sqlite3-1.3.9
  b. Enter the cmd: ruby setup.rb config — –with-sqlite3-include=c:\ruby200\devkit\sqlite-autoconf- 3080600 -with-sqlite3-lib=c:\ruby200\devkit\sqlite-autoconf-3080600\.libs
  c. Enter the cmd: ruby setup.rb setup

8. Update specifications directory
  a. Go to directory c:\ruby200\lib\ruby\gems\2.0.0\cache
  b. Enter the cmd: ruby spec sqlite3-1.3.9.gem –ruby > ..\specifications\sqlite3-1.3.9.gemspec
  c. Enter the cmd: gem list (you should now see sqlite3 on the list)

9. Copy the “”sqlite_native.so” from C:\Ruby200\lib\ruby\gems\2.0.0\gems\sqlite3-1.3.9\ext\sqlite3 to C:\Ruby200\lib\ruby\gems\2.0.0\gems\sqlite3-1.3.9\lib

GEM FILE (for windows only)

1. open Gemfile.lock

2. delete “sqlite (3.0.1-x86-mingw32)” and “bcrypt-ruby (3.0.1-x86-mingw32)”

gem install bcrypt-ruby –platform=ruby –no-ri –no-rdoc

3. Any gem with -x86-mingw32 will not install properly using bundle install, beware the -x86-mingw32 will come back when you run a bundle update. This means to try not to run a bundle update and if you do after every time you run it you will have to repeats steps 1 and 2.

INSTALL SUBLIME(Or your favorite editor)
1. Download Sublime text editor from (http://www.sublimetext.com/3)

2. doskey subl=”C:\Program Files\Sublime Text 2\sublime_text.exe” $*

INSTALL GIT

INSTALL HEROKU

Advertisements