Thursday, December 12, 2013

Installing Ruby using RVM

RVM (Ruby Version Manager) - program that lets you use several versions of Ruby on one VPS. In this we will use ruby 2.0.0p247

Step 1: Install RVM

Update the system.
sudo yum update
make sure you have curl on the system
sudo yum install curl
To install RVM
curl -L get.rvm.io | bash -s stable
After it is done installing, load RVM. To install RVM
source /etc/profile.d/rvm.sh
To check all the dependencies of the RVM. Install the results using rvmsudo.
rvm requirements
Additional Dependencies:
# For Ruby / Ruby HEAD (MRI, Rubinius, & REE), install the following:
  ruby: yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison iconv-devel ## NOTE: For centos >= 5.4 iconv-devel is provided by glibc
rvmsudo yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison iconv-devel

Step 2: Install Ruby

I want to use ruby 2.0.0p247 and I will download in via rvm remote installation. You can skip the two command below and proceed to the next on but If you need some information or you want to another version of ruby you can check the rvm help and list
rvm help install
rvm list known
To get ruby 2.0.0p247 fron remote
rvm list remote
To download and install: rvm install {name} --binary
rvm install ruby-2.0.0-p247 --binary
Check the your ruby version and the location.
ruby -v
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux]
which ruby
/usr/local/rvm/rubies/ruby-2.0.0-p247/bin/ruby
reference: https://www.digitalocean.com/community/articles/how-to-install-ruby-on-rails-on-centos-6-with-rvm

Wednesday, December 4, 2013

Solved "-bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory" on Centos 6.5 (64 bit)



Don't want to see:

-bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory

Solution:

execute
[root@CentosAshley ~]# locale
Result for english language
[root@CentosAshley ~]# locale
LANG=en_US.UTF-8
LC_CTYPE=ja_JP.UTF-8
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
Go to the /etc/sysconfig/i18n and add
LC_ALL=en_US.UTF-8
SUPPORTED=en_US.UTF-8:en_US:en 
then on the .bashrc
export LC_TYPE=en_US.UTF-8
export LC_All=en_US.UTF-8
Don't forget to source .bashrc && reboot
then
[root@CentosAshley ~]# locale
LANG=en_US.UTF-8
LC_CTYPE=UTF-8
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=