Install Ruby on Rails easily on CentOS 6.4 with rbenv

Open Terminal

Install git:

sudo yum install git

Install ruby environment with RBENV:

git clone ~/.rbenv

echo ‘export PATH=”$HOME/.rbenv/bin:$PATH”‘ >> ~/.bashrc

echo ‘eval “$(rbenv init -)”‘ >> ~/.bashrc

to check: restart terminal then type: type rbenv

If it say #=> “rbenv is a function” bla bla bla, it is successfull rbenv install

Install Ruby (2.1.2 version):

Install plugin ruby-build on rbenv:

git clone ~/.rbenv/plugins/ruby-build

echo ‘export PATH=”$HOME/.rbenv/plugins/ruby-build/bin:$PATH”‘ >> ~/.bashrc

restart terminal

Install ruby 2.1.2 version:

rbenv install 2.1.2

then make it global ruby version on your local environment:

rbenv global 2.1.2

rehash the rbenv:

rbenv rehash

to check type: ruby

Install bundler:

gem install bundler

rehash the rbenv:

rbenv rehash

Install Rails:

First, you must install nodejs:

sudo yum install npm

check if it successfull: node –version

install rails:

gem install rails

long wait…

rehash the rbenv:

rbenv rehash

to check type: rails

Categories: IT | Tags: , , , , , | Leave a comment

Install psycopg2 in Linux with Python 3

It’s hard to install psycopg2 on a Linux server that running python 3.

First of all, you need to install python3-dev. The python3-dev package is required for compilation of Python 3 extensions written in C or C++, like psycopg2. If you’re running a Debian-based distribution (e.g. Ubuntu, linux mint), you can install python3-dev by running:

apt-get install python3-dev

Then you can install psycopg2 normally (here is example with a python package manager):

pip install psycopg2

If you’re using python2, you should install python-dev instead

Categories: IT | Tags: , , , | Leave a comment

Iksans Blog 2013 in review

The stats helper monkeys prepared a 2013 annual report for this blog.

Here’s an excerpt:

Madison Square Garden can seat 20,000 people for a concert. This blog was viewed about 62,000 times in 2013. If it were a concert at Madison Square Garden, it would take about 3 sold-out performances for that many people to see it.

Click here to see the complete report.

Categories: Uncategorized | Leave a comment

Yii: Add New Field/Coloumn Table after Generate Its Model

Maybe it’s hard to you to update your class model of a table when you’ve just add a new field/coloumn/attribute. It causes no effect on Create and Update application.

For example, you add coloumn post_code on your user table.
Then you should update the model (model/User.php):
– on function rules() just add new line:¬†array(‘post_code’, ‘numerical’, ‘integerOnly’=>true),

– on function attributeLabels() add new line, to define its name: ‘post_code’ => ‘Post Code’,

– maybe you should update some related views file

Hope this will helping you

Categories: IT | Tags: , , | 1 Comment

Blog at