Ruby

Instale e gerencie Ruby localmente (Windows, macOS, Linux) usando instaladores ou gerenciadores de versão; use Bundler para dependências.

🧾 Visão Geral

Ruby é usado para bots, APIs (Sinatra) e frameworks completos (Rails). A instalação local permite gerenciar gems e testar antes de fazer o upload.


📥 Instalação (escolha uma)

1

Baixe o Ruby+Devkit mais recente (x64) de https://rubyinstaller.org/downloads/

2

Execute o instalador (habilite MSYS2 quando solicitado).

3

Deixe o script pós-instalação terminar (configuração da toolchain).

4

Verifique e instale bundler

ruby -v
gem -v
gem install bundler
bundler -v
5

Inicialize projeto (opcional)

bundle init
bundle install

✅ Verificação

ruby -v
gem -v
bundler -v

Todos os comandos devem mostrar versões.


💎 Gerenciando Gems

1

Inicializar

bundle init
2

Adicionar ao Gemfile

gem "httparty"
3

Instalar / atualizar

bundle install
bundle update httparty
4

Executar script com ambiente bloqueado

bundle exec ruby app.rb

🔄 Atualização

Alvo
Comando

Ruby (rbenv)

rbenv install <version> && rbenv global <version>

Todas gems

bundle update

Uma gem

bundle update <name>

Bundler

gem install bundler


🗃 Comandos Comuns

gem list
gem install <name>
gem uninstall <name>
bundle init
bundle install
bundle update
bundle exec ruby main.rb

Last updated