rbenv / ruby-build

A tool to download, compile, and install Ruby on Unix-like systems.
https://rbenv.org/man/ruby-build.1
MIT License
3.89k stars 785 forks source link

definition not found error for listed definition #602

Closed mgamba closed 10 years ago

mgamba commented 10 years ago

I'm running into an issue where there's a "definition not found" error for something returned in the "install --list". I rebased on master on both rbenv and ruby-build before running this command.

bash$ rbenv-install `rbenv install --list | grep 547`
ruby-build: definition not found: 1.9.3-p547

You can list all available versions with `rbenv install --list'.

If the version you're looking for is not present, first try upgrading
ruby-build. If it's still missing, open a request on the ruby-build
issue tracker: https://github.com/sstephenson/ruby-build/issues

I was also getting a "command not found" error but I changed rbenv-hooks install to rbenv hooks install to move past it.

mislav commented 10 years ago

Please run rbenv install (no dash) instead of rbenv-install. I don't understand how the latter works for you because it's shouldn't be in your PATH by default.

Are you sure that both rbenv and ruby-build are updated to their latest versions? Did you install ruby-build as an rbenv plugin or via Homebrew?

mgamba commented 10 years ago

ruby-build was installed as both an rbenv plug-in and homebrew installation

homebrew version was on master with commit 8eac19a from 2014-07-18

plug-in version was on master with commit c819790 from 2014-07-02

Running with just the plug-in:

bash$ brew uninstall ruby-build
Uninstalling /usr/local/Cellar/ruby-build/20130806...
...
bash$ rbenv install `rbenv install --list | grep 547`
ruby-build: definition not found: 1.9.3-p547

You can list all available versions with `rbenv install --list'.

If the version you're looking for is not present, first try upgrading
ruby-build. If it's still missing, open a request on the ruby-build
issue tracker: https://github.com/sstephenson/ruby-build/issues

Re-installing the homebrew installation and running with both:

==> Installing ruby-build
==> Downloading https://github.com/sstephenson/ruby-build/archive/v20140702.tar.gz
######################################################################## 100.0%
==> ./install.sh
🍺  /usr/local/Cellar/ruby-build/20140702: 122 files, 524K, built in 2 seconds
bash$: rbenv install `rbenv install --list | grep 547`
ruby-build: definition not found: 1.9.3-p547

You can list all available versions with `rbenv install --list'.

If the version you're looking for is not present, first try upgrading
ruby-build. If it's still missing, open a request on the ruby-build
issue tracker: https://github.com/sstephenson/ruby-build/issues

Removing the plug-in and running with just the homebrew installation:

bash$ mv ~/.rbenv/plugins/ruby-build ~/Desktop/rubybuild
bash$ rbenv install `rbenv install --list | grep 547`
ruby-build: definition not found: 1.9.3-p547

You can list all available versions with `rbenv install --list'.

If the version you're looking for is not present, first try upgrading
ruby-build. If it's still missing, open a request on the ruby-build
issue tracker: https://github.com/sstephenson/ruby-build/issues

Removing the brew installation and trying to run with neither:

bash$ brew uninstall ruby-build
Uninstalling /usr/local/Cellar/ruby-build/20140702...
bash$ rbenv install `rbenv install --list | grep 547`
rbenv: no such command `install'
rbenv: no such command `install'
mislav commented 10 years ago

I would suggest nuking the Homebrew version and just going with the plugin, but you already tried that and it didn't work. It's pretty bizarre that a version that was obtained using --list is not available for rbenv install. Can you try again, this time with debug enabled? RBENV_DEBUG=1 rbenv install ...

mgamba commented 10 years ago
bash$ RBENV_DEBUG=1 rbenv install `rbenv install --list | grep 547`
+ '[' -z '' ']'
+ RBENV_ROOT=/Users/mgamba/.rbenv
+ export RBENV_ROOT
+ '[' -z '' ']'
++ pwd
+ RBENV_DIR=/Users/mgamba/.rbenv/plugins/ruby-build
+ export RBENV_DIR
+ shopt -s nullglob
++ abs_dirname /usr/local/bin/rbenv
+++ pwd
++ local cwd=/Users/mgamba/.rbenv/plugins/ruby-build
++ local path=/usr/local/bin/rbenv
++ '[' -n /usr/local/bin/rbenv ']'
++ cd /usr/local/bin
++ local name=rbenv
+++ resolve_link rbenv
++++ type -p greadlink readlink
++++ head -1
+++ /usr/bin/readlink rbenv
++ path=../Cellar/rbenv/0.4.0/bin/rbenv
++ '[' -n ../Cellar/rbenv/0.4.0/bin/rbenv ']'
++ cd ../Cellar/rbenv/0.4.0/bin
++ local name=rbenv
+++ resolve_link rbenv
++++ type -p greadlink readlink
++++ head -1
+++ /usr/bin/readlink rbenv
++ path=../libexec/rbenv
++ '[' -n ../libexec/rbenv ']'
++ cd ../libexec
++ local name=rbenv
+++ resolve_link rbenv
++++ type -p greadlink readlink
++++ head -1
+++ /usr/bin/readlink rbenv
+++ true
++ path=
++ '[' -n '' ']'
++ pwd
++ cd /Users/mgamba/.rbenv/plugins/ruby-build
+ bin_path=/usr/local/Cellar/rbenv/0.4.0/libexec
+ for plugin_bin in '"${RBENV_ROOT}/plugins/"*/bin'
+ bin_path=/usr/local/Cellar/rbenv/0.4.0/libexec:/Users/mgamba/.rbenv/plugins/ruby-build/bin
+ export PATH=/usr/local/Cellar/rbenv/0.4.0/libexec:/Users/mgamba/.rbenv/plugins/ruby-build/bin:/Users/mgamba/.rbenv/shims:/Users/mgamba/.rbenv/shims:/usr/local/bin:/usr/local/sbin:/Users/mgamba/.datapipeline-cli:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/go/bin
+ PATH=/usr/local/Cellar/rbenv/0.4.0/libexec:/Users/mgamba/.rbenv/plugins/ruby-build/bin:/Users/mgamba/.rbenv/shims:/Users/mgamba/.rbenv/shims:/usr/local/bin:/usr/local/sbin:/Users/mgamba/.datapipeline-cli:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/go/bin
+ hook_path=:/Users/mgamba/.rbenv/rbenv.d:/usr/local/etc/rbenv.d:/etc/rbenv.d:/usr/lib/rbenv/hooks
+ export RBENV_HOOK_PATH=:/Users/mgamba/.rbenv/rbenv.d:/usr/local/etc/rbenv.d:/etc/rbenv.d:/usr/lib/rbenv/hooks
+ RBENV_HOOK_PATH=:/Users/mgamba/.rbenv/rbenv.d:/usr/local/etc/rbenv.d:/etc/rbenv.d:/usr/lib/rbenv/hooks
+ shopt -u nullglob
+ command=install
+ case "$command" in
++ command -v rbenv-install
+ command_path=/Users/mgamba/.rbenv/plugins/ruby-build/bin/rbenv-install
+ '[' -z /Users/mgamba/.rbenv/plugins/ruby-build/bin/rbenv-install ']'
+ shift 1
+ exec /Users/mgamba/.rbenv/plugins/ruby-build/bin/rbenv-install '1.9.3-p547'
+ '[' '1.9.3-p547' = --complete ']'
+ '[' -z /Users/mgamba/.rbenv ']'
++ ruby-build --lib
+ eval 'lib () 
{ 
    function parse_options () 
    { 
        OPTIONS=();
        ARGUMENTS=();
        local arg option index;
        for arg in "$@";
        do
            if [ "${arg:0:1}" = "-" ]; then
                if [ "${arg:1:1}" = "-" ]; then
                    OPTIONS[${#OPTIONS[*]}]="${arg:2}";
                else
                    index=1;
                    while option="${arg:$index:1}"; do
                        [ -n "$option" ] || break;
                        OPTIONS[${#OPTIONS[*]}]="$option";
                        index=$(($index+1));
                    done;
                fi;
            else
                ARGUMENTS[${#ARGUMENTS[*]}]="$arg";
            fi;
        done
    };
    if [ "$1" == "--$FUNCNAME" ]; then
        declare -f "$FUNCNAME";
        echo "$FUNCNAME \"\$1\";";
        exit;
    fi
}
lib "$1";'
++ lib '1.9.3-p547'
++ '[' '1.9.3-p547' == --lib ']'
+ unset FORCE
+ unset SKIP_EXISTING
+ unset KEEP
+ unset VERBOSE
+ unset HAS_PATCH
+ parse_options '1.9.3-p547'
+ OPTIONS=()
+ ARGUMENTS=()
+ local arg option index
+ for arg in '"$@"'
+ '[' 1 = - ']'
+ ARGUMENTS[${#ARGUMENTS[*]}]='1.9.3-p547'
+ unset VERSION_NAME
+ DEFINITION='1.9.3-p547'
+ '[' -n '1.9.3-p547' ']'
+ '[' -n '1.9.3-p547' ']'
+ declare -a before_hooks after_hooks
+ OLDIFS='  
'
+ IFS='
'
+ scripts=(`rbenv-hooks install`)
++ rbenv-hooks install
+ '[' install = --complete ']'
+ RBENV_COMMAND=install
+ '[' -z install ']'
+ shopt -s nullglob
+ for path in '${RBENV_HOOK_PATH//:/'\''
'\''}'
+ for path in '${RBENV_HOOK_PATH//:/'\''
'\''}'
+ for path in '${RBENV_HOOK_PATH//:/'\''
'\''}'
+ for path in '${RBENV_HOOK_PATH//:/'\''
'\''}'
+ shopt -u nullglob
+ IFS='     
'
+ '[' -n '' ']'
+ VERSION_NAME='1.9.3-p547'
+ PREFIX='/Users/mgamba/.rbenv/versions/1.9.3-p547'
+ '[' -d '/Users/mgamba/.rbenv/versions/1.9.3-p547' ']'
+ '[' -d '/Users/mgamba/.rbenv/versions/1.9.3-p547/bin' ']'
+ '[' -n '' ']'
+ '[' -z '' ']'
+ '[' -d /Users/mgamba/.rbenv/cache ']'
++ rbenv-global
+ export RBENV_VERSION=2.0.0-p353
+ RBENV_VERSION=2.0.0-p353
+ trap cleanup SIGINT
+ STATUS=0
+ ruby-build '1.9.3-p547' '/Users/mgamba/.rbenv/versions/1.9.3-p547'
ruby-build: definition not found: 1.9.3-p547
+ STATUS=2
+ '[' 2 == 2 ']'
++ definitions '1.9.3-p547'
++ local 'query=1.9.3-p547'
++ ruby-build --definitions
+++ type -p ggrep grep
+++ head -1
++ /usr/bin/grep -F '1.9.3-p547'
++ true
+ candidates=
+ '[' -n '' ']'
+ echo

+ echo 'You can list all available versions with `rbenv install --list'\''.'
You can list all available versions with `rbenv install --list'.
+ echo

+ echo 'If the version you'\''re looking for is not present, first try upgrading'
If the version you're looking for is not present, first try upgrading
+ echo 'ruby-build. If it'\''s still missing, open a request on the ruby-build'
ruby-build. If it's still missing, open a request on the ruby-build
+ echo 'issue tracker: https://github.com/sstephenson/ruby-build/issues'
issue tracker: https://github.com/sstephenson/ruby-build/issues
+ '[' 2 == 0 ']'
+ cleanup
+ '[' -z '' ']'
+ rm -rf '/Users/mgamba/.rbenv/versions/1.9.3-p547'
+ exit 2
mgamba commented 10 years ago

it was a wetware malfunction ...

I was feeding rbenv

bash$ rbenv install --list | grep 547
  1.9.3-p547

when I thought I was feeding it 1.9.3-p547

mislav commented 10 years ago

I don't fully understand. What caused your issue?

mgamba commented 10 years ago

I was installing with rbenv-installrbenv install --list | grep 547` which is slightly different thanrbenv-install 1.9.3-p547. The version argument wasn't making it todefinitions()` function

mislav commented 10 years ago

The version argument wasn't making it to definitions() function

How come?

barbaragabriela commented 10 years ago

Hey, what happened here?, Im having the same issue

mgamba commented 10 years ago

I don't have that computer with me right now, but I think it was in bin/rbenv-install and somehow DEFINITION="${ARGUMENTS[0]}" was not set to the version, probably because of how I passed it in.