ROll MY OWn: Ruby Version Manager

Simple tool to easily change your machine's ruby version to your liking.

Disclaimer

I am only been testing on Mac. I still haven't tried testing on Ubuntu or Windows.

History

Since the machine that I am using right now doesn't have that much capacity to store a lot, I became picky with the tools that I install. I first make sure that they satisfy what I really wanted.

I have read a lot about the other ruby version managers out there (their documentation, code and stuff like that) and I realized that the only thing I really wanted in a version manager is a method to set my path to where I installed the ruby that I want to use.

I haven't been experiencing any problems with my setup right now but if anyone found that this method will eventually break something feel free to comment.

Requirement

As of this writing, the gem assumes that your rubies are compiled and installed in ~/.rubies directory

Usage

  1. Install the gem gem install romyow
  2. Create a .ruby-version file on your current directory echo '2.0.0-p0' > .ruby-version
  3. Run romyow

Alternatively, you can run romyow $ruby_version if you don't want to have a separate .ruby-version file

  1. See the changes to your env paths
  • echo $PATH : $HOME/.rubies/2.0.0-p0/bin:$PATH
  • gem env home : $HOME/.rubies/2.0.0-p0/lib/ruby/gems/2.0.0
  • gem env path : $HOME/.gem/ruby/2.0.0:$HOME/.rubies/2.0.0-p0/lib/ruby/gems/2.0.0

Optional Instructions

  • Add romyow to your ~/.bash_profile to automatically set up your ruby env upon logging in to your shell
  command -v romyow >/dev/null && romyow
  • Customize bash prompt (this is to make sure your bash prompt does not change to default when you use romyow)
  export PS1="\h:\W \u\$ "
  export PS2="\h:\W \u\$ "
  export PS3="\h:\W \u\$ "
  export PS4="\h:\W \u\$ "

TODOs

  1. Ability to compile and install rubies in the ~/.rubies directory for full RVM experience
  2. Ability to uninstall rubies

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Credits

This project is highly inspired by gs