Skip to content

Instantly share code, notes, and snippets.

@thiagomoretto
Created October 13, 2010 18:42
Show Gist options
  • Save thiagomoretto/624617 to your computer and use it in GitHub Desktop.
Save thiagomoretto/624617 to your computer and use it in GitHub Desktop.
Instalacao do ambiente Ruby/Rails no RedHat 5.5
===============================================
Observacao: Na instalacao em outro S.O. (Linux) o processo eh muito parecido
Toda a instalacao foi feita como root. Se feita com algum usuario o RVM sera
instalado na pasta do usuario, e nao para todo o sistema. Atente-se a isso e
na duvida veja na documentacao do RVM.
0. Requisitos
-------------
gcc, libc?-dev, make, autoconf, build-essentials e pacotes desse tipo.
ImageMagick
Para resolver os requisitos use o YUM. No caso, eu peguei a maquina com
esses requisitos jah atendidos. No caso do ImageMagick, eh soh executar
# yum install ImageMagick
1. O que sera instalado
-----------------------
RVM --> OpenSSL --> Ruby --> GIT --> Oracle InstantClient --> Ruby-OCI8 --> ...
mod_rails (Phusion Passenger) --> GEMs necessarios para a aplicacao.
2. Instalacao
-------------
Remova qualquer instalacao do ruby previamente instalada.
# yum erase ruby
Instalar RVM (lasted)
# bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-latest )
ou
# curl -O http://rvm.beginrescueend.com/releases/rvm-install-latest
# . rvm-install-latest
No final do arquivo /etc/profile adicionar:
[[ -s "/usr/local/rvm/scripts/rvm" ]] && . "/usr/local/rvm/scripts/rvm"
Recarregue o profile:
# . /etc/profile
Depois openssl, ruby e rubygems:
# rvm package install openssl
# rvm install 1.8.7 -C --with-openssl-dir=/usr/local/rvm/usr
# rvm use 1.8.7
Testar a versao:
# ruby -v
ruby 1.8.7 (2010-08-16 patchlevel 302) [x86_64-linux]
*Deve aparecer a versao que o RVM baixou e instalou*
Baixar GIT:
# mkdir files/
# wget http://kernel.org/pub/software/scm/git/git-1.7.3.1.tar.bz2
# cd git...
# ./configure --prefix=/usr/local/
# make && make install
# git --version
git version 1.7.3.1
Oracle InstantClient Linux x64
Basic e SDK (ou RVM ou o ZIP)
http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html
# rpm -ivh oracle-instantclient11.2-basic-11.2.0.2.0.x86_64.rpm
# rpm -ivh oracle-instantclient11.2-devel-11.2.0.2.0.x86_64.rpm
Para ver os arquivos instalados:
# rpm -ql oracle-instantclient11.2-basic
# rpm -ql oracle-instantclient11.2-devel
Criei um gemset usando rvm para testar a instalacao do ruby-oci8.
# rvm gemset create teste_oci8
Defina a LD_LIBRARY_PATH para encontrar os *.so do instantclient:
# export LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/lib/
# gem install ruby-oci8 --no-ri --no-rdoc
Building native extensions. This could take a while...
Successfully installed ruby-oci8-2.0.4
1 gem installed
Instalando phusion passenger (mod_rails):
# gem install passenger --no-ri --no-rdoc
# passenger-install-apache2-module
... working in progress ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment