It can be quite frustrating to setup Ruby On Rails in a Plesk-Environment, if you don’t want to use the build-in Ruby or Phusion Application. I deploy my RoR-Apps with mina deploy and use RVM for different Gemsets und Ruby-Versions. Of cource, you can use the Application build in Plesk (rbenv, Ruby in a specific version), but sometimes it’s not suitable.
Let’s assume, that the source code is in the directory /home/rails/my_app/. Deployed by mina, git or something else.
Apache Settings in Plesk
You can specify Apache directives in the Apache & nginx Settings of your domain or subdomain:
In my case, my application is accessable only over HTTPS, so I use these configurations:
# Tell Apache and Passenger where your app's 'public' directory is
# Relax Apache security settings
Allow from all
# Uncomment this if you're on Apache > 2.4:
#Require all granted
My apps are located in the home directory of the user „rails“. The ruby directory is the standard RVM location for the gemset „app_gemset“.
If the Ruby On Rails Application is configured correct (database.yml, file permissions etc.) you should see the HTML, if you open the domain or subdomain in a browser – but without the assets (images, CSS, JS etc.).
Outsmart static files processing
You have to unselect the following point on the Apache & nginx Settings Page:
After this small change, the Ruby On Rails application should be shown correct in your browser.