Category Archives: ruby

Install Ruby Gem

wget  http://production.cf.rubygems.org/rubygems/rubygems-1.8.21.tgz
tar xzvf rubygems-1.8.21.tgz
cd rubygems-1.8.21/
ruby setup.rb
gem update --system

Install mysql2 gem for Ruby

apt-get install libmysql-ruby libmysqlclient-dev
gem install mysql2

Fix zlib error on gem install

apt-get install zlib1g zlib1g-dev
cd /path/to/ruby/ext/zlib
ruby extconf.rb --with-zlib-include=/usr/include --with-zlib-lib=/usr/lib

Destroy Model on RoR

if you already create de table (rake db:create / rake db:migrate)

rake db:rollback

run this:

rails destroy model Modelname

Install database (RoR)

rake db:create
rake db:migrate
rake db:seed

Install Ruby 1.9.3 with libyaml

wget http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz
tar xzvf yaml-0.1.4.tar.gz
cd yaml-0.1.4
./configure --prefix=/usr/local
make
make install
wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p0.tar.gz
tar xzvf ruby-1.9.3-p0.tar.gz
cd ruby-1.9.3-p0
./configure --prefix=/usr/local --enable-shared --disable-install-doc --with-opt-dir=/usr/local/lib
make
make install

test

ruby -v
gem --version
Page 1 of 11