11 articles Ruby

Ruby, a programming language available on Developer+ accounts.

Running Discourse

Discourse is a popular forum software written in Ruby. Because Discourse relies on Docker, which is incompatible with the platform, installation must be carried out manually. A Pro package is recommended to run Discourse as each worker is approximately 200 MB. Getting Started Installation is done within the Terminal. Checkout the Discourse repository from GitHub…

File uploads in a Passenger-backed application fail

Overview A file upload initiated in an application written in Ruby, Node, or Python launched through Passenger will fail to upload. Thus far, the confirmed failure occurs in RefineryCMS with a generic undefined route message following upload. Cause It is a conflict between upload screening and Passenger, but the underlying cause is not clearly understood. Upload…

PostgreSQL gem install fails

Overview Attempting to install the Ruby gem “pg” or other PostgreSQL-dependent gems on v6+ platforms fail with a similar sample response: Can’t find the PostgreSQL client library (libpq) *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You…

Write permission error when installing gems

Overview On newer v6+ platforms with support for multiple Ruby interpreters, installing a gem may fail resulting in a similar error message: [user@sol ~]$ gem install –no-rdoc –no-ri passenger rails Fetching: passenger-5.0.6.gem (100%) ERROR: While executing gem … (Gem::FilePermissionError) You don’t have write permissions for the /.socket/ruby/gems/ruby-2.1.2 directory. Cause The environment variable GEM_HOME is not configured…

Viewing launcher errors

Overview Applications launched by Passenger on v6+ platforms may emit output on stdout or stderr channels. Any output emitted is logged to an aggregate log called passenger.log in /var/log. Important: since these logs are combined among all accounts using Passenger, never output anything confidential to stdout or stderr when launched using Passenger. Once an application is up and…

Disabling Passenger built-in error handler

Overview Passenger provides a user-friendly, on-screen error handler to assist debugging a Python/Ruby/Node.js application. During production, however, this may result in unnecessary and possibly dangerous information disclosure. You can turn off Passenger’s built-in logger and use Apache’s generic error handler by adding the following line to your .htaccess file located within the public/ folder of your app:…

Restarting Passenger processes

Overview An application launched by Passenger may be restarted by creating a file in tmp/ (NB: not /tmp) within the application root directory, usually one level down from public/. Create a file under tmp/ named restart.txt to restart the application once. A restart will happen within 2 minutes. To restart an application on every request, very useful for…