{"action":"created","issue":{"url":"https://api.github.com/repos/rvm/rvm/issues/3845","repository_url":"https://api.github.com/repos/rvm/rvm","labels_url":"https://api.github.com/repos/rvm/rvm/issues/3845/labels{/name}","comments_url":"https://api.github.com/repos/rvm/rvm/issues/3845/comments","events_url":"https://api.github.com/repos/rvm/rvm/issues/3845/events","html_url":"https://github.com/rvm/rvm/issues/3845","id":196541040,"number":3845,"title":"`rvm use` fails on macOS when invoked from inside shell script ","user":{"login":"AndrewSB","id":3814772,"avatar_url":"https://avatars.githubusercontent.com/u/3814772?v=3","gravatar_id":"","url":"https://api.github.com/users/AndrewSB","html_url":"https://github.com/AndrewSB","followers_url":"https://api.github.com/users/AndrewSB/followers","following_url":"https://api.github.com/users/AndrewSB/following{/other_user}","gists_url":"https://api.github.com/users/AndrewSB/gists{/gist_id}","starred_url":"https://api.github.com/users/AndrewSB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndrewSB/subscriptions","organizations_url":"https://api.github.com/users/AndrewSB/orgs","repos_url":"https://api.github.com/users/AndrewSB/repos","events_url":"https://api.github.com/users/AndrewSB/events{/privacy}","received_events_url":"https://api.github.com/users/AndrewSB/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-12-19T22:50:10Z","updated_at":"2016-12-24T01:32:43Z","closed_at":null,"body":"## Description\r\nI've written a script that tries to install `rvm` on `macOS` if the machine doesn't already have it. You can see the contents of the script [here](https://github.com/AndrewSB/dotfiles/blob/871d1e2724805b975006d9f6af2063bb96b0ae05/machine-setup-functions.sh#L65). The selected line is where the script errors out.\r\n\r\nThe error I get is:\r\n```\r\nRVM is not a function, selecting rubies with 'rvm use ...' will not work.\r\n\r\nYou need to change your terminal emulator preferences to allow login shell.\r\nSometimes it is required to use `/bin/bash --login` as the command.\r\nPlease visit https://rvm.io/integration/gnome-terminal/ for an example.\r\n\r\n/Users/asb/.rvm/bin/rvm: line 66: shell_session_update: command not found\r\n```\r\n\r\nI believe the problem is that I'm trying to execute `rvm use` from inside a shell script instead of directly entering in the command from a terminal? Because `rvm use` succeeds if directly entered in instead\r\n\r\n## Steps to reproduce\r\n\r\n 1. Be on macOS 10.12.1, but this probably repros on other versions as well\r\n 2. Clone GitHub.com/AndrewSB/dotfiles\r\n 3. execute `./ensure_machine_setup.sh` in Terminal.app\r\n\r\n## Expected behavior\r\n\r\n`rvm` installs the latest ruby\r\n\r\n## Actual behavior\r\n\r\n* [script output](https://gist.github.com/AndrewSB/730189c9db9ac66380be8b0af4f5be6d)\r\n* [script output with `--trace` enabled](https://gist.github.com/AndrewSB/4fdfce3f0e490ce114076bf09beced12)\r\n\r\n## Environment info\r\n\r\n```\r\nsystem:\r\n\r\n  system:\r\n    uname:       \"Darwin Andrews-MacBook-Pro.local 16.1.0 Darwin Kernel Version 16.1.0: Wed Oct 19 20:31:56 PDT 2016; root:xnu-3789.21.4~4/RELEASE_X86_64 x86_64\"\r\n    system:      \"osx/10.12/x86_64\"\r\n    bash:        \"/bin/bash => GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin16)\"\r\n    zsh:         \"/bin/zsh => zsh 5.2 (x86_64-apple-darwin16.0)\"\r\n\r\n  rvm:\r\n    version:      \"rvm 1.28.0 (latest) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]\"\r\n    updated:      \"7 minutes 52 seconds ago\"\r\n    path:         \"/Users/asb/.rvm\"\r\n\r\n  homes:\r\n    gem:          \"not set\"\r\n    ruby:         \"not set\"\r\n\r\n  binaries:\r\n    ruby:         \"/usr/bin/ruby\"\r\n    irb:          \"/usr/bin/irb\"\r\n    gem:          \"/usr/bin/gem\"\r\n    rake:         \"/usr/bin/rake\"\r\n\r\n  environment:\r\n    PATH:         \"/Users/asb/go/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/asb/.rvm/bin\"\r\n    GEM_HOME:     \"\"\r\n    GEM_PATH:     \"\"\r\n    MY_RUBY_HOME: \"\"\r\n    IRBRC:        \"\"\r\n    RUBYOPT:      \"\"\r\n    gemset:       \"\"\r\n```"},"comment":{"url":"https://api.github.com/repos/rvm/rvm/issues/comments/269062807","html_url":"https://github.com/rvm/rvm/issues/3845#issuecomment-269062807","issue_url":"https://api.github.com/repos/rvm/rvm/issues/3845","id":269062807,"user":{"login":"seanbrecke","id":7804791,"avatar_url":"https://avatars.githubusercontent.com/u/7804791?v=3","gravatar_id":"","url":"https://api.github.com/users/seanbrecke","html_url":"https://github.com/seanbrecke","followers_url":"https://api.github.com/users/seanbrecke/followers","following_url":"https://api.github.com/users/seanbrecke/following{/other_user}","gists_url":"https://api.github.com/users/seanbrecke/gists{/gist_id}","starred_url":"https://api.github.com/users/seanbrecke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seanbrecke/subscriptions","organizations_url":"https://api.github.com/users/seanbrecke/orgs","repos_url":"https://api.github.com/users/seanbrecke/repos","events_url":"https://api.github.com/users/seanbrecke/events{/privacy}","received_events_url":"https://api.github.com/users/seanbrecke/received_events","type":"User","site_admin":false},"created_at":"2016-12-24T01:32:43Z","updated_at":"2016-12-24T01:32:43Z","body":"Made the change and got the same output\r\n```\r\nRVM is not a function, selecting rubies with 'rvm use ...' will not work.\r\n\r\nYou need to change your terminal emulator preferences to allow login shell.\r\nSometimes it is required to use `/bin/bash --login` as the command.\r\nPlease visit https://rvm.io/integration/gnome-terminal/ for an example.\r\n```"}}
{"actor":{"display_login":"seanbrecke"}}