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)
Baixe o Ruby+Devkit mais recente (x64) de https://rubyinstaller.org/downloads/
Execute o instalador (habilite MSYS2 quando solicitado).
Deixe o script pós-instalação terminar (configuração da toolchain).
Verifique e instale bundler
ruby -v
gem -v
gem install bundler
bundler -v
Inicialize projeto (opcional)
bundle init
bundle install
✅ Verificação
ruby -v
gem -v
bundler -v
Todos os comandos devem mostrar versões.
💎 Gerenciando Gems
Inicializar
bundle init
Adicionar ao Gemfile
gem "httparty"
Instalar / atualizar
bundle install
bundle update httparty
Executar script com ambiente bloqueado
bundle exec ruby app.rb
🔄 Atualização
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