Gemfile

Comprehensive Gemfile guide for Ruby bots and web (site/API) applications on Discloud.

🗂️ What is 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)

1

Initialize Bundler in an empty folder:

bundle init

This creates a starter Gemfile.

2

Add dependencies directly via Bundler:

bundle add sinatra
bundle add puma
3

Install (respecting the Gemfile):

bundle install

Install Bundler if missing: gem install bundler.


🧪 Environment Groups

group :development, :test do
	gem 'pry'
	gem 'rspec'
end

group :production do
	# production-only gems (APM, logging backends, etc.)
end

Skip installing dev/test groups at deploy time if desired:


🧩 Example Gemfiles


🧾 Sample 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