Skip to content

Commit ed1a6b4

Browse files
committed
step by step for ubuntu and mac os
0 parents  commit ed1a6b4

File tree

5 files changed

+315
-0
lines changed

5 files changed

+315
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Step by Step guide to install Ruby & Rails on Unix
2+
===
3+
4+
This project is a guide through Ruby/Rails instalation for Rails newcomers. I'll try to update the guides as soon as new versions of Ubuntu and MacOS are released to make sure all steps continue to work. Any contribution is very welcome via pull requests.
5+
6+
English versions in "en" folder.
7+
8+
Instalando e configurando Ruby e Rails no Unix
9+
===
10+
11+
Este projeto é um passo a passo para auxiliar novos desenvoledores a começarem com Ruby e Rails em ambientes Unix. A medida que novas versões forem lançadas eu farei atualizações nesse repositório para garantir que os passos continuam funcionando. Contribuições com novas versões também são bem vindas (pull request plz).
12+
13+
Versões em Português na pasta "pt".

en/macos_snowleopard.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
RUBY and RAILS on MacOSX SnowLeopard
2+
===
3+
4+
Step by step guide to install Rails(last version) and Ruby (1.9.2) on MacOSX SnowLeopard. I'll use Textmate as text editor but you could use anything you want(TextEdit, Vim ou anything else).
5+
6+
**1º Installing XCode**
7+
8+
When install some gems you'll need a compiler and other development tools. In Mac OSX install disk you can optionally install the development tools that include XCode and the compiler. You can also download from Apple's site.
9+
10+
**2º Installing RVM**
11+
12+
OSX comes with Ruby and Rails pre-installed but I'll use RVM to have more controle over Ruby versions. Run the command below in Terminal.app :
13+
14+
bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )
15+
16+
**3º Loading RVM with your Terminal**
17+
18+
In Terminal type:
19+
20+
mate ~/.bash_profile
21+
22+
On the first line put:
23+
24+
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' >> ~/.bash_profile
25+
26+
Now you need to load the file (in Terminal run):
27+
28+
. ~/.bash_profile
29+
30+
**4º Installing Ruby**
31+
32+
Run (this command will take a couple of minutes)
33+
34+
rvm install 1.9.2
35+
36+
Now set ruby 1.9.2 as default for your user, in this way every time you load a new Terminal session Ruby 1.9.2 will be the default:
37+
38+
rvm --default use 1.9.2
39+
40+
Now this should work:
41+
42+
ruby -v
43+
44+
**5º Installing Rails**
45+
46+
gem install rails
47+
48+
**6 ºMySQL(OPICIONAL)**
49+
50+
In development mode, most of the time, sqlite is enough but if you want to use MySQL the right gem is mysql2 (before install the gem you should install MySQL DMG from Oracle's site):
51+
52+
gem install mysql2
53+
54+
Text Editor
55+
===
56+
57+
For text editing my choice is TextMate but this is a matter of taste and how MacOS don't come with a good and simple builtin Text Editor and XCode is not easy to setup to run well with Ruby you can choose anything you want (MacVim, Emacs or even IDE's).

en/ubuntu_10.10.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
RUBY e RAILS NO UBUNTU (10.10)
2+
===
3+
4+
Step by step guide to install Rails (last version) and Ruby (1.9.2) on Ubuntu. We also cover some GEdit setting with GMate plugin.
5+
6+
You can also download the torrent of the Virtualbox Image if you want to run Ubuntu on top of a virtual machine. If you downloaded please help seeding.
7+
8+
**1º Update apt-get**
9+
10+
Open the terminal and run:
11+
12+
sudo apt-get update
13+
14+
**2º Install GIT and Curl**
15+
16+
sudo apt-get install build-essential git-core curl
17+
18+
**3º Install RVM (Ruby Version Manager)**
19+
20+
RVM let you install and manage more than one Ruby version. But here we'll use only one:
21+
22+
bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )
23+
24+
**4º Loading RVM**
25+
26+
Open the .bashrc file:
27+
28+
gedit ~/.bashrc
29+
30+
Put the code below in the first line, save and close:
31+
32+
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' >> ~/.bashrc
33+
34+
Reload the file (in Terminal):
35+
36+
. ~/.bashrc
37+
38+
**5º Installing the other essential packages**
39+
40+
rvm notes
41+
42+
The above command will display the missing packages to install. Just copy and paste the line like below:
43+
44+
sudo apt-get install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev
45+
46+
**6º Installing Ruby**
47+
48+
Run (this command will take a couple of minutes)
49+
50+
rvm install 1.9.2
51+
52+
Set ruby 1.9.2 as the default to your user:
53+
54+
rvm --default use 1.9.2
55+
56+
Now this should work:
57+
58+
ruby -v
59+
ruby 1.9.2p136 (2010-12-25 revision 30365) [x86_64-linux]
60+
61+
**7º Installing Rails**
62+
63+
gem install rails
64+
65+
66+
**8ºMySQL and PostgreSQL (OPTIONAL)**
67+
68+
In development mode most of the time sqlite is enough. If you want to use MySQL the right Gem is mysql2 but before you should do:
69+
70+
sudo apt-get libmysqlclient16-dev
71+
72+
And after:
73+
74+
gem install mysql2
75+
76+
For PostgreSQL:
77+
78+
sudo apt-get libpq-dev
79+
80+
And after:
81+
82+
gem install pg
83+
84+
85+
Setup GEdit
86+
===
87+
88+
For GEdit we'll use GMate plugin. In Terminal:
89+
90+
sudo apt-add-repository ppa:ubuntu-on-rails/ppa
91+
sudo apt-get update
92+
sudo apt-get install gedit-gmate
93+
94+
Now open GEdit got Edit/Preferences menu and in Plug-ins check all. Now everything is ready.

pt/macos_snowleopard.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
RUBY e RAILS NO MacOSX SnowLeopard
2+
===
3+
4+
Guia passo a passo de instalação do Rails (última versão) e Ruby (1.9.2) no MacOSX SnowLeopard. Eu utilizarei o Textmate como Editor mas você pode utilizar qualquer um que desejar (TextEdit, Vim ou qualquer outro).
5+
6+
**1º Instalando XCode**
7+
8+
Durante a instalação de algumas gems e pacotes será necessário um compilador. Ele está disponível através do SDK de desenvolvimento da Apple no DVD do Sistema Operacional ou baixando o XCode no site da Apple.
9+
10+
**2º Instalando RVM**
11+
12+
OSX já vem com Ruby e Rails instalados mas utilizaremos o RVM para termos maior controle sobre versão do Ruby e Gems. Rode o comando abaixo no Terminal.app :
13+
14+
bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )
15+
16+
**3º Carregando RVM no seu Terminal**
17+
18+
Ainda no Terminal digite
19+
20+
mate ~/.bash_profile
21+
22+
Coloque a primeira linha como abaixo, salve e feche:
23+
24+
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' >> ~/.bash_profile
25+
26+
Agora basta recarregar o arquivo (no Terminal digite):
27+
28+
. ~/.bash_profile
29+
30+
**4º Instalando o Ruby**
31+
32+
Rode o comando abaixo (vai demorar alguns minutos)
33+
34+
rvm install 1.9.2
35+
36+
Coloque o ruby 1.9.2 como default do seu user, dessa forma seu terminal vai ignorar o Ruby da Apple:
37+
38+
rvm --default use 1.9.2
39+
40+
Agora o comando abaixo deve funcionar:
41+
42+
ruby -v
43+
44+
**5º Instalando o Rails**
45+
46+
gem install rails
47+
48+
**6 ºMySQL (OPICIONAL)**
49+
50+
Para modo de desenvolvimento a maioria das vezes sqlite é suficiente e já foi instalado. Se você pretende usar MySQL a Gem correta é mysql2 (instale a Gem depois de instalar o DMG do MySQL):
51+
52+
gem install mysql2
53+
54+
Configurando Editor de Texto
55+
===
56+
57+
Como Editor de Texto utilizo o Textmate mas editor é uma questão de gosto e aprender a dominar o que escolheu. Como MacOS não possui nenhum editor gráfico mais robusto por default e o XCode não é simples de configurar para Ruby vamos deixar a decisão entre qual editor com você.

pt/ubuntu_10.10.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
RUBY e RAILS NO UBUNTU (10.10)
2+
===
3+
4+
Passo a passo para a instalação do Rails (última versão) e Ruby (1.9.2) no Ubuntu. Também envolve aos ajustes do GEdit com instalação do GMate.
5+
6+
Aqui você também pode baixar o torrent para a imagem do VirtualBox se preferir rodar o Ubuntu sobre uma Máquina Virtual em conjunto com Windows. Se baixou por favor colabore como seeder.
7+
8+
**1º Atualizando apt-get**
9+
10+
Abra o terminal e rode:
11+
12+
sudo apt-get update
13+
14+
**2º Instalando GIT e Curl**
15+
16+
sudo apt-get install build-essential git-core curl
17+
18+
**3º Instalando RVM (Ruby Version Manager)**
19+
20+
O RVM permite instalar e gerenciar várias versões do Ruby. Mas nós usaremos só uma:
21+
22+
bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )
23+
24+
**4º Carregando RVM no seu Terminal**
25+
26+
Abrindo o arquivo .bashrc:
27+
28+
gedit ~/.bashrc
29+
30+
Coloque a primeira linha como abaixo, salve e feche:
31+
32+
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' >> ~/.bashrc
33+
34+
Agora basta recarregar o arquivo (no Terminal digite):
35+
36+
. ~/.bashrc
37+
38+
**5º Instalando os outros pacotes essenciais**
39+
40+
rvm notes
41+
42+
Comando acima ao final mostrará quais pacotes faltam. Basta copiar e colar no terminal ou copiar a linha abaixo:
43+
44+
sudo apt-get install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev
45+
46+
**6ºInstalando o Ruby**
47+
48+
Rode o comando abaixo (vai demorar alguns minutos)
49+
50+
rvm install 1.9.2
51+
52+
Coloque o ruby 1.9.2 como default do seu user:
53+
54+
rvm --default use 1.9.2
55+
56+
Agora o comando abaixo deve funcionar:
57+
58+
ruby -v
59+
ruby 1.9.2p136 (2010-12-25 revision 30365) [x86_64-linux]
60+
61+
**7º Instalando o Rails**
62+
63+
gem install rails
64+
65+
66+
**8ºMySQL e PostgreSQL (OPICIONAL)**
67+
68+
Para modo de desenvolvimento a maioria das vezes sqlite é suficiente e já foi instalado. Se você pretende usar MySQL a Gem correta é mysql2 mas antes deve rodar:
69+
70+
sudo apt-get libmysqlclient16-dev
71+
72+
Depois:
73+
74+
gem install mysql2
75+
76+
Se pretende usar PostgreSQL faça:
77+
78+
sudo apt-get libpq-dev
79+
80+
Depois:
81+
82+
gem install pg
83+
84+
85+
Configurando GEdit
86+
===
87+
88+
Para o GEdit usaremos o plugin GMate que tratará snippets, colorização e uma série de coisas úteis para o dia a dia. Ainda no Terminal:
89+
90+
sudo apt-add-repository ppa:ubuntu-on-rails/ppa
91+
sudo apt-get update
92+
sudo apt-get install gedit-gmate
93+
94+
Abra o GEdit vá em Editar/Edit Preferências/Preferences e em Plug-ins habilite todos. Agora você pode criar sua primeira aplicação Rails e trabalhar com um bom editor.

0 commit comments

Comments
 (0)