Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$PATH in .ruby-env is not expanded #4701

Open
betesh opened this issue May 22, 2019 · 1 comment
Open

$PATH in .ruby-env is not expanded #4701

betesh opened this issue May 22, 2019 · 1 comment

Comments

@betesh
Copy link

betesh commented May 22, 2019

Description

When I put PATH=~/temp/bin:$PATH in a .ruby-env file, it treats $PATH as a literal, instead of expanding it. This is a change of behavior introduced in rvm 1.29.0.

git bisect helped me determine that this was introduced by 83edbd9

Steps to reproduce

~ $ mkdir -p ~/temp/bin && echo "2.4.0" >> ~/temp/.ruby-version && echo "PATH=~/temp/bin:\$PATH" >> ~/temp/.ruby-env

# With 1.28.0, this is valid: $PATH is the usual list of directores, including /bin, /sbin, etc
~ $ rvm get 1.28.0 && rvm reload && rvm in ~/temp do true 

# With all versions since 1.29.0, including stable and master, this blows up:
# $PATH is ~/temp/bin:$PATH, i.e. $PATH is not getting expanded when used recursively
~ $ rvm get master && rvm reload && rvm in ~/temp do true
/usr/bin/env: ‘bash’: No such file or directory
Command 'sed' is available in '/bin/sed'
The command could not be located because '/bin' is not included in the PATH environment variable.
sed: command not found

Expected behavior

$PATH should start with ~/temp/bin and then continue with the value of $PATH defined in ~/.bashrc

Actual behavior

$PATH is set to '~/temp/bin:$PATH', without $PATH being expanded

Environment info

rvm info:

ruby-2.4.0:

  system:
    uname:        "Linux my_machine_name 4.15.0-50-generic #54~16.04.1-Ubuntu SMP Wed May 8 15:55:19 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux"
    name:         "Ubuntu"
    version:      "16.04"
    architecture: "x86_64"
    bash:         "/bin/bash => GNU bash, version 4.3.48(1)-release (x86_64-pc-linux-gnu)"
    zsh:          " => not installed"
    remote_path:  "ubuntu/16.04/x86_64"

  rvm:
    version:      "1.29.8-next (master)"
    updated:      "1 minute 41 seconds ago"
    path:         "/home/me/.rvm"
    autolibs:     "[4] Allow RVM to use package manager if found, install missing dependencies, install package manager (only OS X)."

  ruby:
    interpreter:  "ruby"
    version:      "2.4.0p0"
    date:         "2016-12-24"
    platform:     "x86_64-linux"
    patchlevel:   "2016-12-24 revision 57164"
    full_version: "ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-linux]"

  homes:
    gem:          "/home/me/.rvm/gems/ruby-2.4.0"
    ruby:         "/home/me/.rvm/rubies/ruby-2.4.0"

  binaries:
    ruby:         "/home/me/.rvm/rubies/ruby-2.4.0/bin/ruby"
    irb:          "/home/me/.rvm/rubies/ruby-2.4.0/bin/irb"
    gem:          "/home/me/.rvm/rubies/ruby-2.4.0/bin/gem"
    rake:         "/home/me/.rvm/gems/ruby-2.4.0/bin/rake"

  environment:
    PATH:         "/home/me/.rvm/gems/ruby-2.4.0/bin:/home/me/.rvm/gems/ruby-2.4.0@global/bin:/home/me/.rvm/rubies/ruby-2.4.0/bin:/home/me/.rvm/bin:/home/me/.nvm/versions/node/v6.2.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
    GEM_HOME:     "/home/me/.rvm/gems/ruby-2.4.0"
    GEM_PATH:     "/home/me/.rvm/gems/ruby-2.4.0:/home/me/.rvm/gems/ruby-2.4.0@global"
    MY_RUBY_HOME: "/home/me/.rvm/rubies/ruby-2.4.0"
    IRBRC:        "/home/me/.rvm/rubies/ruby-2.4.0/.irbrc"
    RUBYOPT:      ""
    gemset:       ""
@betesh
Copy link
Author

betesh commented Nov 3, 2020

I just checked and this is still an issue in the latest master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant