1 | sudo apt-get install curl bison build-essential zlib1g-dev libssl-dev libreadline6-dev libxml2-dev git-core subversion autoconf sqlite3 libsqlite3-dev ruby-full rake rubygems |
Atualização (03/12/2010): As instruções funcionam também no Debian. A única diferença é no debian stable “lenny” onde basta trocar libreadline6-dev por libreadline5-dev.
Atualização (18/03/2011): Como o Felypeguimaraes lembrou nos comentários, só use “sudo” nos comandos onde estiver escrito “sudo”, se usar sudo para instalar o rvm ou gem, etc, não vai funcionar.
1 | ruby -v |
bash < <(curl https://rvm.beginrescueend.com/install/rvm)
You must now finish the install manually:1) Place the folowing line at the end of your shell's loading files(.bashrc or .bash_profile for bash and .zshrc for zsh), after all path/variable settings:[[ -s $HOME/.rvm/scripts/rvm ]] && source $HOME/.rvm/scripts/rvm2) Ensure that there is no 'return' from inside the .bashrc file. (otherwise rvm will be prevented from working properly).This means that if you see '[ -z ] && return' then you must change this line to:if [[ ! -z ]] ; then… original content that was below the && return line …fi # <= be sure to close the if.#EOF .bashrcBe absolutely *sure* to REMOVE the '&& return'.If you wish to DRY up your config you can 'source ~/.bashrc' at the bottom of your .bash_profile.placing all non-interactive items in the .bashrc, including the 'source' line above
1 | cp .bashrc .bashrc_part2 |
[[ -s $HOME/.rvm/scripts/rvm ]] && source $HOME/.rvm/scripts/rvm if [[ ! -z "$PS1" ]] ; then source ~/.bashrc_part2 fi
1 | rvm info |
1 | ruby -v |
(rvm install ruby-head) instalou o 1.9.3dev, testando mais um pouco vi que o head dá problema quando vai usar o console do rails, então é melhor instalar o 1.9.2 mesmo
1 | rvm install 1.9.2 |
1 | ruby -v |
(rvm –default ruby-head)
1 | rvm --default 1.9.2 |
1 | ruby -v |
1 | gem install sqlite3-ruby |
1 | gem install rails |
ERROR: Error installing rails: mail requires i18n (~> 0.4.1, runtime)
1 | gem install mail |
E depois desinstalar o i18n versão 5
1 | gem uninstall i18n |
Select gem to uninstall: 1. i18n-0.4.2 2. i18n-0.5.0 3. All versions
Escolha a opção 2.
1 | rails new appteste1 |
1 | cd appteste1 |
1 | rails s |
Extras:
Mysql
1 | sudo apt-get install mysql-server |
1 | gem install mysql2 |
Se por algum motivo aparecer esse erro:
ERROR: Error installing mysql: ERROR: Failed to build gem native extension. ...
A solução é:
1 | sudo apt-get install libmysqlclient-dev |
Agora já dá para gerar um rails usando mysql.
1 | rails new appmysql1 -d mysql |
Problemas:
1 2 | gem sources -a http://gems.rubyforge.org<br /> gem sources -r http://rubygems.org/ |
Quando a gente compete só a gente ganha, quando a gente colabora, todos ganham.