Gemfile
Comprehensive Gemfile guide for Ruby bots and web (site/API) applications on Discloud.
🗂️ What is Gemfile?
Gemfile?Gemfile lists the gems (libraries) your Ruby application needs. Discloud uses Bundler during deployment to install them before starting your app.
🛠️ Creating a Gemfile (Quick Start)
Gemfile (Quick Start)1
Initialize Bundler in an empty folder:
bundle initThis creates a starter Gemfile.
2
Add dependencies directly via Bundler:
bundle add sinatra
bundle add puma3
Install (respecting the Gemfile):
bundle install🧪 Environment Groups
group :development, :test do
gem 'pry'
gem 'rspec'
end
group :production do
# production-only gems (APM, logging backends, etc.)
endSkip installing dev/test groups at deploy time if desired:
🧩 Example Gemfiles
🧾 Sample config.ru (Sinatra / Rack Site)
config.ru (Sinatra / Rack Site)For bots you typically do NOT need config.ru; instead just point MAIN in discloud.config to your Ruby entry (e.g. bot.rb).
🧪 Updating Dependencies
Security patches: monitor advisories (e.g., RubySec / Dependabot) and schedule periodic bundle update --patch.
🧰 Common Commands Reference
Last updated