-
-
Save ltfschoen/aa549bcb5df9c98d95c81aee4a9a69cf to your computer and use it in GitHub Desktop.
Switch from RVM to RBENV
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Prepare ################################################################### | |
| # Remove RVM | |
| rvm implode | |
| # Ensure your homebrew is working properly and up to date | |
| brew doctor | |
| brew update | |
| ## Install ################################################################### | |
| brew install rbenv | |
| brew install ruby-build | |
| ## Config #################################################################### | |
| # Ignore version files that rbenv makes, also pesky .DS_Store's | |
| git config --global core.excludesfile ~/.gitignore | |
| printf ".rbenv-version\n.DS_Store\n" >> ~/.gitignore | |
| # Ignore locally bundled gems | |
| mkdir -p ~/.bundle | |
| printf -- "---\nBUNDLE_PATH: vendor/bundle" >> ~/.bundle/config | |
| # Instantiate rbenv with your shell (choose preferred file - .profile, .bash_profile, etc) | |
| printf 'eval "$(rbenv init -)"' >> ~/.profile | |
| # Reload your profile | |
| . ~/.profile | |
| ## Usage ##################################################################### | |
| rbenv | |
| # Choose a ruby flavor version to install | |
| rbenv install 1.9.3-p0 | |
| rbenv install 1.9.2-p290 | |
| # Rehash rbenv shims (run this after installing binaries) | |
| rbenv rehash | |
| # Set the global Ruby version | |
| rbenv global 1.9.3-p0 | |
| # Set a project specific ruby version | |
| touch ~/projects/newhotness/.rbenv-version | |
| rbenv local 1.9.2-p290 | |
| # Install bundler into current ruby's gemset | |
| gem install bundler | |
| rbenv rehash | |
| # Install gems in Gemfile to vendor/bundle | |
| cd ~/projects/newhotness | |
| bundle | |
| # Start app in context of bundled gems | |
| bundle exec rails s | |
| ## RubyMine Notes ############################################################ | |
| # Open settings | Ruby SDK & Gems | |
| # Remove ALL RVM related SDK's | |
| # Add new Ruby SDK for project - Find path by found by running `rbenv which ruby` in project directory | |
| # Edit launch/debug configurations | Bundler - enable/check - Run the script in the context of bundler | |
| # Note: RubyMine debugger will install some additional needed gems into your global gem path - eg) ~/.gem/ruby/... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment