Thursday, March 14, 2013

RubyOnRails - A few steps installing and creating first project

#Install MySql
yum grouplist | grep -i mysql
yum groupinstall "MySQL Database"

# If fail..........
vi /usr/bin/mysql_install_db  # edit hostname=127.0.0.1

# Start MySql....
usr/bin/mysql_install_db --user=mysql
service mysqld start
/usr/bin/mysqladmin version
/usr/bin/mysqlshow
mysql -u root

# Install RubyOnRails
wget http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz
tar -zxvf yaml-0.1.4.tar.gz
cd yaml-0.1.4
./configure
./configure --prefix=/usr/local
make
make install

wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz
tar -zxvf ruby-1.9.3-p194.tar.gz
cd ruby-1.9.3-p194
./configure
make
make install

# Check Ruby Version
ruby --version

# Install Rubygems
wget http://rubyforge.org/frs/download.php/76073/rubygems-1.8.24.tgz
tar -zxvf rubygems-1.8.24.tgz
cd rubygems-1.8.24
ruby setup.rb

# Check Gems Version
gem --version

# Install Rake
gem update --system
gem install therubyracer -v '0.9.8'
gem install rake
gem install rails

# Check Installed Gems
cd ..
gem list

# Create your first Application
rails new welcome -d mysql
cd welcome
rails generate controller welcome index
vi Gemfile # Add... gem 'therubyracer', require: "v8"
bundle install
rake db:create

# Configure route to access your first application
vi config/routes.rb # Uncomment root :to => 'welcome#index'

# Start rail server
rails server

# Check your application
http://127.0.0.1:3000/welcome/index


No comments:

Post a Comment