|source $HOME/.bashrc # if rvm is sourced there.|
|# alternatively you can: source $HOME/.rvm/scripts/rvm|
|# Select 1.8.7|
|rvm use 1.8.7|
|# Output the current ruby version|
|# Display the information about the current environment, within this script.|
|# List installed rubies|
Hi @wayneeqeguin, question about using rvm in scripts. I am building some simple scripts to setup a stack (I know you have a tool for this and hope to get to the point where I can use yours soon). I am using rvm because the stack runs several things in several different rubies. In getting each ruby environment setup I need to do things like script the installation of some gems. Those commands are done in sub-shells of the script being run, and always pickup my default Ruby I think, instead of the ruby I tell it to use on the line just prior.
I have read about how to use rvm in scripts, and am sourcing rvm properly I think. I am just not sure why
I am using bsfl (my own heavily modified fork) to run the commands and get nice feedback printed back to screen on success/fail. I don't think it is doing any magic that would make it different from just running
in a script.
This is the underlying function that is running the gem install commands:
OK I tried your example and modified it a bit, and understand why it doesn't work.