Short answer: Ruby applications (Rack, Sinatra, Ruby on Rails) run in Plesk through the Ruby extension, with Phusion Passenger handling the process. You choose a Ruby version and the application directory containing a config.ru file. Its public subdirectory must be the public directory. You install dependencies from the Gemfile with the Bundle install button, and restart either from the panel or with the tmp/restart.txt file. Below is a step-by-step walkthrough, a minimal application, and problems typical of hosting with account isolation.
How Plesk runs a Ruby application
The Ruby extension uses Phusion Passenger, the same application server as the Node.js Toolkit. Passenger looks for a config.ru file (the Rack standard) in the application directory and starts the process on the first request. Each domain can have its own Ruby version, which Plesk selects through rbenv (a .ruby-version file appears in the application directory).
You don't install Ruby yourself — the server administrator provides the versions. You don't need root privileges either: everything described below is done at the subscription user level.
Directory structure
Passenger treats the parent directory of the public directory as the application directory. The simplest approach is to create a subdomain, e.g. app.twojafirma.pl, with the document root app/public:
app/
├── config.ru # punkt startowy Rack
├── Gemfile
├── Gemfile.lock
├── .ruby-version # tworzy Plesk
├── public/ # katalog dokumentów domeny (pliki statyczne)
└── tmp/
└── restart.txt # dotknięcie = restart aplikacji
Configuration files and dependencies live outside public, so they can't be downloaded through the browser.
A minimal application: config.ru and Gemfile
app/config.ru — a Rack application with no framework:
require "json"
run lambda { |env|
body = { ok: true, ruby: RUBY_VERSION, path: env["PATH_INFO"] }.to_json
[200, { "content-type" => "application/json" }, [body]]
}
app/Gemfile:
source "https://rubygems.org"
gem "rack", "~> 3.1"
# gem "sinatra", "~> 4.1" # jeśli wolisz Sinatrę
The Sinatra version, in config.ru:
require "sinatra/base"
class App < Sinatra::Base
get("/") { "Działa: Ruby #{RUBY_VERSION}" }
end
run App
Enabling Ruby in the panel
- Open the domain or subdomain in Websites & Domains and select Ruby.
- Click Enable Ruby and choose a version — for new projects, the newest available is usually best.
- Check that the document root points to
…/public, and the application directory to its parent. - Set the application mode (production) and any environment variables.
- Click Bundle install, then Restart App.
If public still has the default index.html created with the subdomain, delete it — otherwise the web server will show it instead of the application. The new configuration takes effect after the web server reloads (up to 30 minutes at DoSieci).
Gems and Bundler
Bundle install installs gems from the Gemfile for the selected Ruby version. With SSH access, you can do this from the console — it's best to keep gems inside the project directory so they don't mix between applications:
cd ~/app
bundle config set --local path vendor/bundle
bundle config set --local without "development test"
bundle install
bundle exec ruby -e 'require "rack"; puts Rack.release'
Commit the Gemfile.lock file to your repository — that way the server installs exactly the same versions you tested locally.
Native gems and build tools
Some popular gems contain C code and compile during installation: nokogiri (older versions), pg, mysql2, bcrypt, puma. These need a compiler and header libraries. On shared hosting with account isolation (CageFS), the compiler is usually not available to the user, and installation fails with an error:
make: gcc: No such file or directory
What you can do:
- choose a gem version with prebuilt binaries for Linux (e.g. newer
nokogiriinstalls as a platform gem, without compiling); - replace the gem with a pure-Ruby equivalent, if one exists;
- ask your hosting support to build the gem for your application.
Ruby on Rails
Rails works in Plesk the same as any Rack application: the public directory is the project's public, and Rails itself generates config.ru. Before launching, set RAILS_ENV=production and SECRET_KEY_BASE in the environment variables, run migrations, and build assets:
bundle exec rails db:migrate
bundle exec rails assets:precompile
Rails depends on several native gems (a database adapter, bcrypt, often nokogiri). So before deploying, check whether your hosting can install them — this is the most common obstacle for Rails on shared hosting. Rails hasn't been run on our test server yet.
Variables, restart, and logs
- Environment variables (passwords,
DATABASE_URL) — set them in the Ruby panel or in a file outside the public directory. You'll find a PostgreSQL connection example in our guide on PostgreSQL in Plesk. - Restart: Restart App in the panel, or
touch tmp/restart.txtin the application directory. - Logs: Passenger shows startup errors on the error page and records them in the domain's logs; Rails logs are in
log/production.log. - Permissions: application files must belong to the subscription user — this happens automatically when uploading via FTP/SFTP.
Common problems
- "rbenv: version `3.x' is not installed" in the SSH console — the version selected in the panel isn't visible in the account's environment. Use the path given by your hosting support, or run commands through the panel (Bundle install).
- Default page instead of the application — there's an
index.htmlinpublic. - "Could not find gem … in locally installed gems" —
bundle installwasn't run for the same Ruby version selected in the panel. - Gem compilation error (gcc, make) — a native gem; see the section above.
- "The application process exited prematurely" — an error at application startup (see the log for details) or a server-side Passenger configuration issue.
- Changes aren't visible — restart the application; a new domain configuration requires a web server reload.
FAQ
Can I install my own Ruby version?
Not on shared hosting — Ruby versions are installed by the server administrator and made available to all accounts. You choose one of the versions available in the panel.
Sinatra or Rails on hosting?
Sinatra and plain Rack have few native dependencies and are easier to get running. Rails needs more compiled gems and resources, so check first whether your hosting supports them.
How do I restart the application without the panel?
Create or update the tmp/restart.txt file in the application directory.
Where should I install gems?
Best done locally within the project (bundle config set --local path vendor/bundle), so each application has its own set.
Technical verification: 17 September 2026, Plesk Obsidian 18.0.80, Ruby extension 1.6, Ruby 3.3.10 (Bundler 2.5), Passenger 6.1, CloudLinux with CageFS. Related guides: Node.js applications in Plesk, PostgreSQL in Plesk, Docker and Docker Compose in Plesk. Packages: NVMe hosting (Business) and NVMe Performance and Pro.
