wayneeseguin/rvm — Issue #686: path-identifier & __rvm_project_rvmrc can't switch rubies
Author: kliuless
Created: 2012-01-05 20:58:53+00:00
State: open

1.10.0 and 1.10.1-pre both seem to have a problem in tools path-identifier. I think I've narrowed it down to the rvmrc code. 1.9 also didn't work, so I had to downgrade to 1.8.6 to get it working. Seems like it has something to do with my setup (Mac OS 10.5.8), because 1.9.2 works on a Linux box.
For some reason the rvmrc database path is being set to /rvmrc rather than the actual path at /Users/kuser/.rvm/user/rvmrcs (note the message "Database file /rvmrcs does not exist"). This prevents the switch and $GEM_HOME isn't set correctly.

Calling path-identifier will then output the currently selected ruby (minus gemset) rather than the ruby@gemset at the specified path. This is causing problems with passenger because the wrapper script relies on path-identifier.

```bash
kuser> bash -c 'set -x; source /Users/kuser/.rvm/scripts/rvm; builtin cd "/Users/kuser/git-tribune/myapp/core"; rvm_promptless=1 __rvm_project_rvmrc > /dev/null; set +x'
+ source /Users/kuser/.rvm/scripts/rvm
++ export HOME rvm_prefix rvm_user_install_flag rvm_path
++ HOME=/Users/kuser
+++ umask
++ : rvm_stored_umask:0022
++ (( 0 == 0 ))
++ for rvmrc in /etc/rvmrc '"$HOME/.rvmrc"'
++ [[ -f /etc/rvmrc ]]
++ for rvmrc in /etc/rvmrc '"$HOME/.rvmrc"'
++ [[ -f /Users/kuser/.rvmrc ]]
++ grep '^\s*rvm .*$' /Users/kuser/.rvmrc
++ source /Users/kuser/.rvmrc
+++ export rvm_path=/Users/kuser/.rvm
+++ rvm_path=/Users/kuser/.rvm
+++ export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home
+++ JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home
++ [[ -z /Users/kuser/.rvm ]]
++ rvm_path=/Users/kuser/.rvm
++ [[ -z '' ]]
+++ dirname /Users/kuser/.rvm
++ rvm_prefix=/Users/kuser
++ [[ -z '' ]]
++ [[ /Users/kuser == \/\U\s\e\r\s\/\k\u\s\e\r ]]
++ rvm_user_install_flag=1
++ [[ -n 3.2.17(1)-release ]]
++ type rvm
++ grep function
++ rvm_loaded_flag=0
++ (( 0 == 0 ))
++ [[ -n /Users/kuser/.rvm ]]
++ [[ -d /Users/kuser/.rvm ]]
++ true /Users/kuser/.rvm/scripts
++ for script in base version selector cd cli override_gem
++ [[ -f /Users/kuser/.rvm/scripts/base ]]
++ source /Users/kuser/.rvm/scripts/base
+++ : rvm_trace_flag:0
+++ (( rvm_trace_flag > 0 ))
+++ [[ 0 > 0 ]]
+++ export __array_start rvm_path
+++ [[ -n '' ]]
+++ __array_start=0
+++ (( 0 == 0 ))
+++ : rvm_stored_umask:0022
+++ for rvmrc in /etc/rvmrc '"$HOME/.rvmrc"'
+++ [[ -f /etc/rvmrc ]]
+++ for rvmrc in /etc/rvmrc '"$HOME/.rvmrc"'
+++ [[ -f /Users/kuser/.rvmrc ]]
+++ grep '^\s*rvm .*$' /Users/kuser/.rvmrc
+++ source /Users/kuser/.rvmrc
++++ export rvm_path=/Users/kuser/.rvm
++++ rvm_path=/Users/kuser/.rvm
++++ export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home
++++ JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home
+++ [[ -z /Users/kuser/.rvm ]]
+++ export rvm_path
+++ true /Users/kuser/.rvm/scripts
+++ source /Users/kuser/.rvm/scripts/initialize
++++ : rvm_trace_flag:0
++++ (( rvm_trace_flag > 0 ))
++++ [[ 0 > 0 ]]
++++ [[ -n 3.2.17(1)-release ]]
++++ shopt -s extglob
++++ export __rvm_env_loaded
++++ : __rvm_env_loaded:0:
++++ : __rvm_env_loaded:1:
++++ [[ -z '' ]]
++++ type __rvm_cleanse_variables
++++ grep 'is a function'
++++ head -n 1
++++ (( 0 == 0 ))
++++ : rvm_stored_umask:0022
++++ for rvmrc in /etc/rvmrc '"$HOME/.rvmrc"'
++++ [[ -f /etc/rvmrc ]]
++++ for rvmrc in /etc/rvmrc '"$HOME/.rvmrc"'
++++ [[ -f /Users/kuser/.rvmrc ]]
++++ grep '^\s*rvm .*$' /Users/kuser/.rvmrc
++++ source /Users/kuser/.rvmrc
+++++ export rvm_path=/Users/kuser/.rvm
+++++ rvm_path=/Users/kuser/.rvm
+++++ export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home
+++++ JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home
++++ [[ -z /Users/kuser/.rvm ]]
++++ export rvm_path
++++ true /Users/kuser/.rvm/scripts
++++ [[ -z 1 ]]
++++ : 'rvm_rc_files:(/Users/kuser/.bash_profile' /Users/kuser/.bashrc '/Users/kuser/.zshenv)' rvm_bin_path:/Users/kuser/.rvm/bin rvm_man_path:/Users/kuser/.rvm/man rvm_archives_path:/Users/kuser/.rvm/archives rvm_docs_path:/Users/kuser/.rvm/docs rvm_environments_path:/Users/kuser/.rvm/environments rvm_examples_path:/Users/kuser/.rvm/examples rvm_gems_path:/Users/kuser/.rvm/gems rvm_gemsets_path:/Users/kuser/.rvm/gemsets rvm_help_path:/Users/kuser/.rvm/help rvm_hooks_path:/Users/kuser/.rvm/hooks rvm_lib_path:/Users/kuser/.rvm/lib rvm_log_path:/Users/kuser/.rvm/log rvm_patches_path:/Users/kuser/.rvm/patches rvm_repos_path:/Users/kuser/.rvm/repos rvm_rubies_path:/Users/kuser/.rvm/rubies rvm_rubygems_path:/Users/kuser/.rvm/rubygems rvm_src_path:/Users/kuser/.rvm/src rvm_tmp_path:/Users/kuser/.rvm/tmp rvm_user_path:/Users/kuser/.rvm/user rvm_usr_path:/Users/kuser/.rvm/usr rvm_wrappers_path:/Users/kuser/.rvm/wrappers rvm_verbose_flag:0 rvm_debug_flag:0 rvm_gems_cache_path:/Users/kuser/.rvm/gems/cache
++++ [[ -n '' ]]
++++ export rvm_action rvm_alias_expanded rvm_archflags rvm_archive_extension rvm_archives_path rvm_bin_flag rvm_bin_path rvm_clang_flag rvm_configure_flags rvm_debug_flag rvm_default_flag rvm_delete_flag rvm_docs_path rvm_docs_type rvm_dump_environment_flag rvm_environments_path rvm_error_message rvm_examples_path rvm_expanding_aliases rvm_file_name rvm_gemdir_flag rvm_gems_cache_path rvm_gems_path rvm_gemset_name rvm_gemset_separator rvm_gemsets_path rvm_gemstone_package_file rvm_gemstone_url rvm_head_flag rvm_help_path rvm_hook rvm_install_args rvm_install_on_use_flag rvm_lib_path rvm_llvm_flag rvm_loaded_flag rvm_log_path rvm_make_flags rvm_niceness rvm_nightly_flag rvm_only_path_flag rvm_parse_break rvm_patch_names rvm_patch_original_pwd rvm_patches_path rvm_path rvm_pretty_print_flag rvm_prior_cc rvm_proxy rvm_quiet_flag rvm_ree_options rvm_reload_flag rvm_remove_flag rvm_repos_path rvm_rubies_path rvm_ruby_alias rvm_ruby_aliases rvm_ruby_args rvm_ruby_binary rvm_ruby_bits rvm_ruby_configure rvm_ruby_file rvm_ruby_gem_home rvm_ruby_gem_path rvm_ruby_global_gems_path rvm_ruby_home rvm_ruby_interpreter rvm_ruby_irbrc rvm_ruby_load_path rvm_ruby_major_version rvm_ruby_make rvm_ruby_make_install rvm_ruby_minor_version rvm_ruby_mode rvm_ruby_name rvm_ruby_package_file rvm_ruby_package_name rvm_ruby_patch rvm_ruby_patch_level rvm_ruby_release_version rvm_ruby_repo_url rvm_ruby_require rvm_ruby_revision rvm_ruby_selected_flag rvm_ruby_sha rvm_ruby_string rvm_ruby_strings rvm_ruby_tag rvm_ruby_url rvm_ruby_user_tag rvm_ruby_version rvm_script_name rvm_scripts_path rvm_sdk rvm_user_install_flag rvm_silent_flag rvm_src_path rvm_sticky_flag rvm_system_flag rvm_tmp_path rvm_token rvm_trace_flag rvm_use_flag rvm_user_flag rvm_user_path rvm_usr_path rvm_verbose_flag rvm_wrapper_name rvm_wrappers_path rvm_ruby_repo_branch rvm_man_path rvm_architectures
+++ case " $rvm_base_except " in
+++ source /Users/kuser/.rvm/scripts/selector
+++ declare -a scripts
+++ scripts=(logging utility init cleanup env rvmrc install environment gemset db bundler)
+++ for entry in '${scripts[@]}'
+++ source /Users/kuser/.rvm/scripts/functions/logging
++++ [[ -t 1 ]]
++++ eval 'rvm_log() { printf "$(tput setaf 2)$*$(tput sgr0)\n" ; }'
++++ eval 'rvm_debug() { printf "$(tput setaf 5)DEBUG: $*$(tput sgr0)\n" ; }'
++++ eval 'rvm_warn() { printf "$(tput setaf 3)WARN: $*$(tput sgr0)\n" ; }'
++++ eval 'rvm_error() { printf "$(tput setaf 1)ERROR: $*$(tput sgr0)\n" >&2 ; }'
+++ for entry in '${scripts[@]}'
+++ source /Users/kuser/.rvm/scripts/functions/utility
+++ for entry in '${scripts[@]}'
+++ source /Users/kuser/.rvm/scripts/functions/init
+++ for entry in '${scripts[@]}'
+++ source /Users/kuser/.rvm/scripts/functions/cleanup
+++ for entry in '${scripts[@]}'
+++ source /Users/kuser/.rvm/scripts/functions/env
+++ for entry in '${scripts[@]}'
+++ source /Users/kuser/.rvm/scripts/functions/rvmrc
++++ export escape_flag _first _second
++++ escape_flag=1
++++ _first=0
++++ _second=1
+++ for entry in '${scripts[@]}'
+++ source /Users/kuser/.rvm/scripts/functions/install
+++ for entry in '${scripts[@]}'
+++ source /Users/kuser/.rvm/scripts/functions/environment
+++ for entry in '${scripts[@]}'
+++ source /Users/kuser/.rvm/scripts/functions/gemset
+++ for entry in '${scripts[@]}'
+++ source /Users/kuser/.rvm/scripts/functions/db
+++ for entry in '${scripts[@]}'
+++ source /Users/kuser/.rvm/scripts/functions/bundler
+++ unset scripts entry rvm_base_except
+++ [[ ! -t 0 ]]
++ for script in base version selector cd cli override_gem
++ [[ -f /Users/kuser/.rvm/scripts/version ]]
++ source /Users/kuser/.rvm/scripts/version
++ for script in base version selector cd cli override_gem
++ [[ -f /Users/kuser/.rvm/scripts/selector ]]
++ source /Users/kuser/.rvm/scripts/selector
++ for script in base version selector cd cli override_gem
++ [[ -f /Users/kuser/.rvm/scripts/cd ]]
++ source /Users/kuser/.rvm/scripts/cd
+++ (( 1 > 0 ))
+++ [[ -n '' ]]
+++ (( 0 == 1 ))
++ for script in base version selector cd cli override_gem
++ [[ -f /Users/kuser/.rvm/scripts/cli ]]
++ source /Users/kuser/.rvm/scripts/cli
++ for script in base version selector cd cli override_gem
++ [[ -f /Users/kuser/.rvm/scripts/override_gem ]]
++ source /Users/kuser/.rvm/scripts/override_gem
+++ [[ 0 -eq 0 ]]
++ __rvm_setup
++ (( __rvm_env_loaded != 1 ))
++ [[ -n '' ]]
++ export __rvm_env_loaded rvm_ruby_strings rvm_head_flag rvm_prior_cc next_token rvm_error_message rvm_gems_cache_path rvm_gems_path rvm_gemset_name rvm_man_path rvm_parse_break rvm_rc_files rvm_ruby_binary rvm_ruby_gem_home rvm_ruby_gem_path rvm_ruby_home rvm_ruby_interpreter rvm_ruby_irbrc rvm_ruby_log_path rvm_ruby_major_version rvm_ruby_minor_version rvm_ruby_package_name rvm_ruby_patch_level rvm_ruby_release_version rvm_ruby_repo_url rvm_ruby_repo_branch rvm_ruby_revision rvm_ruby_selected_flag rvm_ruby_tag rvm_ruby_version rvm_user_install_flag rvm_token rvm_ruby_load_path rvm_path_flag rvm_ruby_require rvm_action rvm_ruby_package_file rvm_ruby_name rvm_static_flag rvm_export_args rvm_ruby_name rvm_ruby_args rvm_default_flag rvm_gems_cache_path rvm_gemset_separator rvm_archives_path rvm_docs_path rvm_environments_path rvm_examples_path rvm_gems_path rvm_gemsets_path rvm_help_path rvm_lib_path rvm_log_path rvm_patches_path rvm_repos_path rvm_rubies_path rvm_scripts_path rvm_src_path rvm_tmp_path rvm_user_path rvm_usr_path rvm_wrappers_path rvm_expanding_aliases rvm_loaded_flag rvm_llvm_flag rvm_architectures rvm_skip_autoreconf_flag rvm_18_flag rvm_19_flag rvm_force_autoconf_flag rvm_autoconf_flags
+++ cat /Users/kuser/.rvm/VERSION
++ rvm_version=1.10.0
++ export rvm_version=1.10.0
++ rvm_version=1.10.0
++ alias 'rvm-restart=rvm_reload_flag=1 source '\''/Users/kuser/.rvm/scripts/rvm'\'''
++ command -v ruby
++ command -v ruby
++ grep -v rvm
++ command -v ruby
++ grep 'rvm/bin/ruby$'
++ __rvm_conditionally_add_bin_path
++ printf '/Users/kuser/.rvm/rubies/ree-1.8.7-2011.03/bin /Users/kuser/bin /Users/kuser/.rvm/bin /opt/local/bin /opt/local/sbin /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin /usr/local/mysql/bin /usr/local/lib/ImageMagick-6.4.1/bin /usr/bin /bin /usr/sbin /sbin /usr/local/bin /usr/X11/bin /usr/local/git/bin'
++ grep -vF /Users/kuser/.rvm/bin
++ return 0
++ (( 0 == 1 ))
++ rvm_loaded_flag=1
++ rvm_reload_flag=0
++ unset rvm_prefix_needs_trailing_slash rvm_rc_files rvm_gems_cache_path rvm_gems_path rvm_project_rvmrc_default rvm_gemset_separator
++ [[ -t 0 ]]
++ [[ 1 -gt 0 ]]
++ [[ ! =~ __rvm_project_rvmrc ]]
++ command -v __rvm_project_rvmrc
++ rvm_promptless=1
++ __rvm_project_rvmrc
++ export __rvm_project_rvmrc_lock
++ : __rvm_project_rvmrc_lock:0
++ : __rvm_project_rvmrc_lock:1
++ (( __rvm_project_rvmrc_lock > 1 ))
++ local working_dir rvm_trustworthiness_result
++ working_dir=/Users/kuser
++ :
++ [[ -z /Users/kuser ]]
++ [[ /Users/kuser == \/\U\s\e\r\s\/\k\u\s\e\r ]]
++ [[ -n '' ]]
++ break
++ unset __rvm_project_rvmrc_lock
++ return 0
++ __rvm_teardown
++ [[ -d /Users/kuser/.rvm/tmp/12376 ]]
++ export __rvm_env_loaded
++ : __rvm_env_loaded:1:
++ : __rvm_env_loaded:1:
++ : __rvm_env_loaded:0:
++ [[ -z /Users/kuser/.rvm/tmp ]]
++ (( __rvm_env_loaded > 0 ))
++ [[ -n '' ]]
++ :
++ (( 0 > 0 ))
++ [[ -n 0022 ]]
++ umask 0022
++ unset __rvm_env_loaded rvm_ruby_strings rvm_head_flag rvm_prior_cc next_token rvm_error_message rvm_gems_cache_path rvm_gems_path rvm_gemset_name rvm_man_path rvm_parse_break rvm_rc_files rvm_ruby_binary rvm_ruby_gem_home rvm_ruby_gem_path rvm_ruby_home rvm_ruby_interpreter rvm_ruby_irbrc rvm_ruby_log_path rvm_ruby_major_version rvm_ruby_minor_version rvm_ruby_package_name rvm_ruby_patch_level rvm_ruby_release_version rvm_ruby_repo_url rvm_ruby_repo_branch rvm_ruby_revision rvm_ruby_selected_flag rvm_ruby_tag rvm_ruby_version rvm_user_install_flag rvm_token rvm_ruby_load_path rvm_path_flag rvm_ruby_require rvm_action rvm_ruby_package_file rvm_ruby_name rvm_static_flag rvm_export_args rvm_ruby_name rvm_ruby_args rvm_default_flag rvm_gems_cache_path rvm_gemset_separator rvm_archives_path rvm_docs_path rvm_environments_path rvm_examples_path rvm_gems_path rvm_gemsets_path rvm_help_path rvm_lib_path rvm_log_path rvm_patches_path rvm_repos_path rvm_rubies_path rvm_scripts_path rvm_src_path rvm_tmp_path rvm_user_path rvm_usr_path rvm_wrappers_path rvm_expanding_aliases rvm_loaded_flag rvm_llvm_flag rvm_architectures rvm_skip_autoreconf_flag rvm_18_flag rvm_19_flag rvm_force_autoconf_flag rvm_autoconf_flags
++ (( 0 == 1 ))
++ trap - 0 1 2 3 15
++ return 0
+ builtin cd /Users/kuser/git-tribune/myapp/core
+ rvm_promptless=1
+ __rvm_project_rvmrc
+ export __rvm_project_rvmrc_lock
+ : __rvm_project_rvmrc_lock:0
+ : __rvm_project_rvmrc_lock:1
+ (( __rvm_project_rvmrc_lock > 1 ))
+ local working_dir rvm_trustworthiness_result
+ working_dir=/Users/kuser/git-tribune/myapp/core
+ :
+ [[ -z /Users/kuser/git-tribune/myapp/core ]]
+ [[ /Users/kuser == \/\U\s\e\r\s\/\k\u\s\e\r\/\g\i\t\-\t\r\i\b\u\n\e\/\m\y\a\p\p\/\c\o\r\e ]]
+ [[ / == \/\U\s\e\r\s\/\k\u\s\e\r\/\g\i\t\-\t\r\i\b\u\n\e\/\m\y\a\p\p\/\c\o\r\e ]]
+ [[ -f /Users/kuser/git-tribune/myapp/core/.rvmrc ]]
+ [[ '' != \/\U\s\e\r\s\/\k\u\s\e\r\/\g\i\t\-\t\r\i\b\u\n\e\/\m\y\a\p\p\/\c\o\r\e\/\.\r\v\m\r\c ]]
+ __rvm_check_rvmrc_trustworthiness /Users/kuser/git-tribune/myapp/core/.rvmrc
+ local saveIFS trust result
+ [[ -n /Users/kuser/git-tribune/myapp/core/.rvmrc ]]
+ [[ 0 == 0 ]]
+ saveIFS='
'
+ IFS=';'
+ trust=($( __rvm_rvmrc_stored_trust "$1" ))
++ __rvm_rvmrc_stored_trust /Users/kuser/git-tribune/myapp/core/.rvmrc
+++ __rvm_rvmrc_key /Users/kuser/git-tribune/myapp/core/.rvmrc
+++ tr '[#/.=]' _
+++ printf /Users/kuser/git-tribune/myapp/core/.rvmrc
+++ return 0
++ /Users/kuser/.rvm/scripts/db /rvmrcs _Users_kuser_git-tribune_myapp_core__rvmrc

Database file /rvmrcs does not exist.

++ return 1
+ IFS='
'
++ __rvm_md5_for_contents /Users/kuser/git-tribune/myapp/core/.rvmrc
++ command -v md5
++ echo /Users/kuser/git-tribune/myapp/core/.rvmrc
++ cat - /Users/kuser/git-tribune/myapp/core/.rvmrc
++ md5
++ return 0
++ __rvm_sha256_for_contents /Users/kuser/git-tribune/myapp/core/.rvmrc
++ command -v sha256sum
++ cat - /Users/kuser/git-tribune/myapp/core/.rvmrc
++ sha256sum
++ echo /Users/kuser/git-tribune/myapp/core/.rvmrc
++ awk '{print $1}'
++ return 0
+ [[ '#' != \8\0\b\e\0\e\c\d\4\6\e\9\8\2\7\3\a\7\6\c\a\4\c\0\9\2\e\d\3\f\a\e\3\f\7\e\3\8\f\6\b\9\3\3\f\0\f\5\7\c\1\8\f\7\a\e\9\7\1\b\9\c\b\8\d\6\b\9\b\0\9\3\c\8\1\c\e\e\d\f\8\7\c\1\d\b\1\a\1\7\d\3\3\a\0\d ]]
+ __rvm_ask_to_trust /Users/kuser/git-tribune/myapp/core/.rvmrc
+ local trusted value anykey _rvmrc
+ _rvmrc=/Users/kuser/git-tribune/myapp/core/.rvmrc
+ [[ ! -t 0 ]]
+ (( 1 == 1 ))
+ return 2
+ result=2
+ unset escape_flag
+ return 2
+ rvm_trustworthiness_result=2
+ unset __rvm_project_rvmrc_lock
+ return 2
+ set +x
kuser>
```