Last Updated: February 25, 2016
·
4.771K
· xijo

Get puma jungle scripts working with rvm

Recently I had some trouble getting the puma webserver to run with the following setup:

  • ruby 1.9.3-p374
  • rvm 1.18.0
  • nginx 1.2.4
  • puma 1.6.3

I wanted to use the jungle scripts (https://github.com/puma/puma/tree/master/tools/jungle) to run several instances. Unfortunately everything looked good but the puma startup process was silently failing. It turned out, that the crash happened because rvm could not be found and loaded.

What I had to do was loading the rvm function by hand

source ~/.bash_profile

during the jungle startup and in order to use the source command I had to change the jungle script to behave as bash script

Change

#! /bin/sh

To

#! /bin/bash

The whole setup is explained by Tommy Chheng (http://tommy.chheng.com/2013/01/23/deploying-a-rails-app-on-nginxpuma-with-capistrano) and I added a gem for convenient capistrano integration (https://github.com/xijo/capistrano-puma).

1 Response
Add your response

Why not just create an RVM wrapper script:

https://rvm.io/integration/init-d/

rvm wrapper ruby-1.9.3-p374 p193 puma

Would create a script p193_puma which would use the correct rvm ruby to launch puma.

over 1 year ago ·