Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


bluepill binary path was not set correctly in RVM-controlled Ruby environment #6

wants to merge 4 commits into from

5 participants


This patch detects RVM and sets bluepill binary path accordingly


This would have saved me some trouble. Hope it gets merged in soon!


Just ran into this problem too. Very frustrating!


The changes in this pull request didn't actually work for me.

As a workaround I added the following code to my recipe:


Hey @alexclear! Thank you for supporting the Opscode Cookbooks! Our process has a couple prerequisites before we can merge your contribution. We need to ensure you've completed a Contributor License Agreement (CLA) and a ticket on our ticket tracker for the release workflow. Pull requests are optional, but should always include the ticket number that they're related to for cross-referencing. Please take a moment to review the below wiki page for the appropriate steps:



I'm going to close this due to inactivity, but please reopen if you have more time to work on this issue :smile:!

@sethvargo sethvargo closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
9 attributes/default.rb
@@ -15,7 +15,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-default["bluepill"]["bin"] = "#{languages[:ruby][:bin_dir]}/bluepill"
+if "#{languages[:ruby][:bin_dir]}" =~ /^.*rvm\/rubies\/(.*)\/bin$/
+ default['bluepill']['gemset'] = $~[1]
+ default['bluepill']['bin'] = "#{languages[:ruby]['gems_dir']}/bin/bluepill"
+ default['bluepill']['rvm_detected'] = true
+ default["bluepill"]["bin"] = "#{languages[:ruby][:bin_dir]}/bluepill"
+ default['bluepill']['rvm_detected'] = false
default["bluepill"]["logfile"] = "/var/log/bluepill.log"
default["bluepill"]["pid_dir"] = "/var/run/bluepill"
default["bluepill"]["state_dir"] = "/var/lib/bluepill"
1  metadata.rb
@@ -4,4 +4,5 @@
description "Installs bluepill gem and configures to manage services, includes bluepill_service LWRP"
long_description, ''))
version "1.0.7"
+name "bluepill"
recipe "bluepill::default", "Installs bluepill rubygem and set up management directories"
7 recipes/default.rb
@@ -31,3 +31,10 @@
group node["bluepill"]["group"]
+if node["bluepill"]["rvm_detected"]
+ execute "create_wrapper" do
+ command "rvm wrapper #{node["bluepill"]["gemset"]} bootup bluepill"
+ not_if "which bootup_bluepill"
+ end
17 templates/centos/bluepill_init.erb
@@ -8,10 +8,25 @@
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 6
-BLUEPILL_BIN=<%= node['bluepill']['bin'] %>
BLUEPILL_CONFIG=<%= @config_file %>
SERVICE_NAME=<%= @service_name %>
+<% if node['bluepill']['rvm_detected'] %>
+# Load RVM into a shell session *as a function*
+if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then
+ # First try to load from a user install
+ source "$HOME/.rvm/scripts/rvm"
+elif [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then
+ # Then try to load from a root install
+ source "/usr/local/rvm/scripts/rvm"
+ printf "ERROR: An RVM installation was not found.\n"
+BLUEPILL_BIN=`which bootup_bluepill`
+<% else %>
+BLUEPILL_BIN=<%= node['bluepill']['bin'] %>
+<% end %>
case "$1" in
echo "Loading bluepill configuration for $SERVICE_NAME "
Something went wrong with that request. Please try again.