rvm 1.10.0-pre calling non existing after use hooks #630

pmontrasio opened this Issue Dec 7, 2011 · 1 comment


None yet

2 participants


I got this bug after updating rvm to 1.10.0-pre
I don't have jruby installed and whenever I rvm use something I get these warnings

jruby_options_remove: command not found
jruby_clean_project_options: command not found

That didn't happened with the previous version of rvm.
The culprit is .rvm/hooks/after_use_jruby_opts (don't know why it's there) being called (probably) by .rvm/hooks/after_use
I patched it to check the existence of the hooks.

#!/usr/bin/env bash

. "${rvm_path}/scripts/functions/hooks/jruby"

function_exists () {
  declare -f $1 > /dev/null

if [[ "${rvm_ruby_string}" =~ "jruby" ]]
  jruby_options_append "${PROJECT_JRUBY_OPTS[@]}"
  if function_exists jruby_options_remove; then
    jruby_options_remove "${PROJECT_JRUBY_OPTS[@]}"
  if function_exists jruby_clean_project_options; then

Something along these lines should be applied to all hooks.

@mpapis mpapis was assigned Dec 7, 2011
@mpapis mpapis closed this in afc1e6c Dec 7, 2011
mpapis commented Dec 7, 2011

i think you hit two issues, first that hook should not be enabled by default, which is fixed with the above commit, you will have to disable it manually as installer persist the -x flag when it was once enabled, you can find instructions how to disable by reading the upgrade notes shown when calling rvm get head

second - the script loaded above (in 3rd line) was not loaded, which is the real issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment