User:Mikeglaz/sandbox

Ruby and Rails has quite a complicated installation procedure. After hours of research and four distros I'm placing these instructions here. I've tested this on Ubuntu 12.04, Linux Mint 12, Debian 6.04, and Fedora 16. In Ubuntu and Mint I'm assuming you're using a sudoer account. In Debian and Fedora I'm assuming you're installing as root. Hopefully others can add to this page and have more distros represented. We can keep this Wiki up until the installation process for Ruby on Rails becomes more streamlined. I used the default installation options for each distro. Note, I tried RVM but I just couldn't get it working. One other thing, the book that I'm reading talks about deploying your application to Heroku. I still haven't figured out how to do that, but once I do I'll post it here.

Prerequisites

 * 1) sudo apt-get install apache2 mysql-server git zlib1g-dev libxslt-dev libxml2-dev libssl-dev libmysqlclient-dev

Install YAML (YAML Ain't Markup Language)

 * 1) Download YAML source
 * 2) Extract YAML: tar -xvf yaml-0.1.4.tar.gz
 * 3) Change into YAML directory: cd yaml-0.1.4
 * 4) Run configuration script: ./configure
 * 5) Compile the source: sudo make
 * 6) Install YAML: sudo make install

Install Ruby from source

 * 1) Download Ruby source
 * 2) Extract Ruby: tar -xvf ruby-1.9.3-p125.tar.gz
 * 3) Change into Ruby directory: cd ruby-1.9.3-p125
 * 4) Run configuration script: ./configure
 * 5) Compile the source: sudo make
 * 6) Install Ruby: sudo make install
 * 7) You can check if Ruby is installed by running ruby -v at the prompt. It should return something like ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-linux]
 * 8) Go into the openssl directory: cd ext/openssl
 * 9) Create a Makefile: sudo ruby extconf.rb
 * 10) Compile: sudo make
 * 11) Install: sudo make install
 * 12) Go into the readline directory cd ../readline
 * 13) Create a Makefile: ruby extconf.rb
 * 14) Compile: sudo make
 * 15) Install: sudo make install

Install RubyGems

 * 1) Download RubyGems
 * 2) Extract RubyGems: tar -xvf rubygems-1.8.21.tgz
 * 3) Change into RubyGems directory cd rubygems-1.8.21
 * 4) Install RubyGems: sudo ruby setup.rb

Install Rails

 * 1) sudo gem install rails
 * 2) gem install nokogiri

Create a new application

 * 1) rails new new_app -d mysql the -d mysql flag indicates that you want to use the MySQL database. If you leave it off Rails defaults to SQLite.
 * 2) Change to new application's directory: cd new_app

Install execjs and therubyracer

 * 1) sudo gem install execjs
 * 2) sudo gem install therubyracer
 * 3) Go into config directory: cd config
 * 4) Edit boot.rb file and add execjs and therubyracer to it.
 * 5) gksudo gedit boot.rb
 * 6) Insert the following 2 lines at the top of boot.rb
 * 7) require 'execjs'
 * 8) require 'v8'
 * 9) Change the User and Password for the development and test environments to correspond to your User name and Password.
 * 10) sudo gedit database.yml

Finish application

 * 1) Go back to new application root directory: cd ..
 * 2) Create a database for your new app: rake db:create
 * 3) Start WEBrick, the Rails server: rails server
 * 4) Point your browser to localhost:3000
 * 5) You should see “Welcome aboard You’re riding Ruby on Rails!”
 * 6) Click on About your application’s environment, if you don't see any errors you're all set.

Prerequisites

 * 1) sudo apt-get install apache2 mysql-server git libxslt-dev libxml2-dev libssl-dev libmysqlclient-dev

Install YAML (YAML Ain't Markup Language)

 * 1) Download YAML source
 * 2) Extract YAML: tar -xvf yaml-0.1.4.tar.gz
 * 3) Change into YAML directory: cd yaml-0.1.4
 * 4) Run configuration script: ./configure
 * 5) Compile the source: sudo make
 * 6) Install YAML: sudo make install

Install Ruby from source

 * 1) Download Ruby source
 * 2) Extract Ruby: tar -xvf ruby-1.9.3-p125.tar.gz
 * 3) Change into Ruby directory: cd ruby-1.9.3-p125
 * 4) Run configuration script: ./configure
 * 5) Compile the source: sudo make
 * 6) Install Ruby: sudo make install
 * 7) You can check if Ruby is installed by running ruby -v at the prompt. It should return something like ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-linux]
 * 8) Go into the openssl directory: cd ext/openssl
 * 9) Create a Makefile: sudo ruby extconf.rb
 * 10) Compile: sudo make
 * 11) Install: sudo make install
 * 12) Go into the readline directory cd ../readline
 * 13) Create a Makefile: ruby extconf.rb
 * 14) Compile: sudo make
 * 15) Install: sudo make install

Install RubyGems

 * 1) Download RubyGems
 * 2) Extract RubyGems: tar -xvf rubygems-1.8.21.tgz
 * 3) Change into RubyGems directory cd rubygems-1.8.21
 * 4) Install RubyGems: sudo ruby setup.rb

Install Rails

 * 1) sudo gem install rails
 * 2) gem install nokogiri

Create a new application

 * 1) rails new new_app -d mysql the -d mysql flag indicates that you want to use the MySQL database. If you leave it off Rails defaults to SQLite.
 * 2) Change to new application's directory: cd new_app

Install execjs and therubyracer

 * 1) sudo gem install execjs
 * 2) sudo gem install therubyracer
 * 3) Go into config directory: cd config
 * 4) Edit boot.rb file and add execjs and therubyracer to it.
 * 5) gksudo gedit boot.rb
 * 6) Insert the following 2 lines at the top of boot.rb
 * 7) require 'execjs'
 * 8) require 'v8'
 * 9) Change the User and Password for the development and test environments to correspond to your User name and Password.
 * 10) sudo gedit database.yml

Finish application

 * 1) Go back to new application root directory: cd ..
 * 2) Create a database for your new app: rake db:create
 * 3) Start WEBrick, the Rails server: rails server
 * 4) Point your browser to localhost:3000
 * 5) You should see “Welcome aboard You’re riding Ruby on Rails!”
 * 6) Click on About your application’s environment, if you don't see any errors you're all set.

Prerequisites

 * 1) apt-get install apache2 mysql-server git zlib1g-dev libreadline-dev libxslt-dev libxml2-dev libssl-dev libmysqlclient-dev g++

Install YAML (YAML Ain't Markup Language)

 * 1) Download YAML
 * 2) Extract YAML: tar -xvf yaml-0.1.4.tar.gz
 * 3) Change into YAML directory: cd yaml-0.1.4
 * 4) Install C Compiler: apt-get install gcc
 * 5) Install make: apt-get install make
 * 6) Run configuration script: ./configure
 * 7) Compile the source: make
 * 8) Install YAML: make install

Install Ruby from source

 * 1) Download Ruby Source
 * 2) Extract Ruby: tar -xvf ruby-1.9.3-p125.tar.gz
 * 3) Change into Ruby directory: cd ruby-1.9.3-p125
 * 4) Run configuration script: ./configure
 * 5) Compile the source: make
 * 6) Install Ruby: make install
 * 7) You can check if Ruby is installed by running ruby -v at the prompt. It should return something like ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-linux]
 * 8) Go into the openssl directory: cd ext/openssl
 * 9) Create a Makefile: ruby extconf.rb
 * 10) Compile: make
 * 11) Install: make install
 * 12) Go into the readline directory cd ../readline
 * 13) Create a Makefile: ruby extconf.rb
 * 14) Compile: make
 * 15) Install: make install

Install RubyGems

 * 1) Download RubyGems
 * 2) Extract RubyGems: tar -xvf rubygems-1.8.21.tgz
 * 3) Change into RubyGems directory: cd rubygems-1.8.21
 * 4) Install RubyGems: ruby setup.rb

Install Rails

 * 1) gem install rails
 * 2) gem install nokogiri

Create a new application

 * 1) rails new new_app -d mysql the -d mysql flag indicates that you want to use the MySQL database. If you leave it off Rails defaults to SQLite.
 * 2) Change to new application's directory: cd new_app

Install execjs and therubyracer

 * 1) gem install execjs
 * 2) gem install therubyracer
 * 3) Go into config directory: cd config
 * 4) Edit boot.rb file and add execjs and therubyracer to it.
 * 5) gedit boot.rb
 * 6) Insert the following 2 lines at the top of boot.rb
 * 7) require 'execjs'
 * 8) require 'v8'
 * 9) Change the User and Password for the development and test environments to correspond to your User name and Password in the MySQL database.
 * 10) gedit database.yml

Finish application

 * 1) Go back to new application root directory: cd ..
 * 2) Create a database for your new app: rake db:create
 * 3) Start WEBrick, the Rails server: rails server
 * 4) Point your browser to localhost:3000
 * 5) You should see “Welcome aboard You’re riding Ruby on Rails!”
 * 6) Click on About your application’s environment, if you don't see any errors you're all set.
 * 7) Learn how to setup Git at Github

Prerequisites

 * 1) yum install httpd mysql mysql-server git zlib-devel libxslt-devel gcc mysql-devel openssl-devel readline-devel
 * 2) Create MySQL password for root: mysql_secure_installation

Start MySQL server and autostart MySQL on boot

 * 1) systemctl start mysqld.service
 * 2) systemctl enable mysqld.service

Start httpd sever and autostart httpd on boot

 * 1) systemctl start httpd.service
 * 2) systemctl enable httpd.service

Install YAML (YAML Ain't Markup Language)

 * 1) Download YAML
 * 2) Extract YAML: tar -xvf yaml-0.1.4.tar.gz
 * 3) Change into YAML directory: cd yaml-0.1.4
 * 4) Run configuration script: ./configure
 * 5) Compile the source: make
 * 6) Install YAML: make install

Install Ruby from source

 * 1) Download Ruby Source
 * 2) Extract Ruby: tar -xvf ruby-1.9.3-p125.tar.gz
 * 3) Change into Ruby directory: cd ruby-1.9.3-p125
 * 4) Run configuration script: ./configure
 * 5) Compile the source: make
 * 6) Install Ruby: make install
 * 7) You can check if Ruby is installed by running ruby -v at the prompt. It should return something like ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-linux]
 * 8) Go into the openssl directory cd ext/openssl
 * 9) Create a Makefile: ruby extconf.rb
 * 10) Compile: make
 * 11) Install: make install
 * 12) Go into the readline directory cd ../readline
 * 13) Create a Makefile: ruby extconf.rb
 * 14) Compile: make
 * 15) Install: make install

Install RubyGems

 * 1) Download RubyGems
 * 2) Extract RubyGems: tar -xvf rubygems-1.8.21.tgz
 * 3) Change into RubyGems directory cd rubygems-1.8.21
 * 4) Install RubyGems: ruby setup.rb

Install Rails

 * 1) gem install rails
 * 2) gem install nokogiri

Create a new application

 * 1) rails new new_app -d mysql the -d mysql flag indicates that you want to use the MySQL database. If you leave it off Rails defaults to SQLite.
 * 2) Change to new application's directory: cd new_app
 * 3) Go into the config directory: cd config
 * 4) Change your username and password for MySQL to what you previously set while installing MySQL for both development and test environments: nano database.yml

Finish application

 * 1) Create a database for your new app: rake db:create
 * 2) Go back to new application root directory: cd ..
 * 3) Start WEBrick, the Rails server: rails server
 * 4) Point your browser to localhost:3000
 * 5) You should see “Welcome aboard You’re riding Ruby on Rails!”
 * 6) Click on About your application’s environment, if you don't see any errors you're all set.
 * 7) Learn how to setup Git at Github