Skip to content

Instantly share code, notes, and snippets.

@ltfschoen
Forked from brentertz/rvm2rbenv.txt
Last active August 8, 2017 13:36
Show Gist options
  • Save ltfschoen/aa549bcb5df9c98d95c81aee4a9a69cf to your computer and use it in GitHub Desktop.
Save ltfschoen/aa549bcb5df9c98d95c81aee4a9a69cf to your computer and use it in GitHub Desktop.

Revisions

  1. ltfschoen revised this gist Aug 8, 2017. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions rvm2rbenv.txt
    Original file line number Diff line number Diff line change
    @@ -11,7 +11,9 @@ brew doctor
    brew update

    ## Install ###################################################################
    # https://github.com/rbenv/rbenv
    brew install rbenv
    rbenv init
    brew install ruby-build

    ## Config ####################################################################
  2. ltfschoen revised this gist Aug 8, 2017. 1 changed file with 29 additions and 0 deletions.
    29 changes: 29 additions & 0 deletions rvm2rbenv.txt
    Original file line number Diff line number Diff line change
    @@ -53,10 +53,39 @@ gem install bundler --pre
    gem install OTHER_GLOBAL_GEMS # eg) Rails, Heroku, etc - NOTE: You need to do this for each ruby version.
    rbenv rehash

    # Show Gems installed
    gem list

    # Install RBEnv Gemset https://github.com/jf/rbenv-gemset
    brew install rbenv-gemset

    # Change into project directory
    cd snapr

    # Install Ruby version required for a specific Ruby app
    rbenv install 2.1.6

    # Initialise Gemset
    rbenv gemset init

    # Create Gemset under specific Ruby version
    rbenv gemset create 2.1.6 app-snapr

    # List Gems installed
    rbenv gemset list

    ruby -v
    which ruby

    # Switch to Ruby version with RBEnv
    rbenv local 2.1.6

    # Set a project specific ruby version
    cd myproject
    rbenv local 1.9.2-p290

    # Install Gems

    # Install gems in Gemfile to vendor/bundle
    cd ~/projects/newhotness
    bundle
  3. ltfschoen revised this gist Aug 8, 2017. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions rvm2rbenv.txt
    Original file line number Diff line number Diff line change
    @@ -2,6 +2,9 @@

    # Remove RVM
    rvm implode
    sudo rm -rf /Users/<your_username>/.rvm/

    # Remove RVM from ~/.bash_profile and ~/.bash_rc

    # Ensure your homebrew is working properly and up to date
    brew doctor
  4. Brent revised this gist Nov 23, 2011. 1 changed file with 1 addition and 3 deletions.
    4 changes: 1 addition & 3 deletions rvm2rbenv.txt
    Original file line number Diff line number Diff line change
    @@ -47,11 +47,9 @@ rbenv rehash
    # Set the global Ruby version and install bundler globally
    rbenv global 1.9.3-p0
    gem install bundler --pre
    gem install OTHER_GLOBAL_GEMS # eg) Rails, Heroku, etc - NOTE: You need to do this for each ruby version.
    rbenv rehash

    # Install any other global gems
    Rails, Heroku, etc

    # Set a project specific ruby version
    cd myproject
    rbenv local 1.9.2-p290
  5. Brent revised this gist Nov 23, 2011. 1 changed file with 5 additions and 4 deletions.
    9 changes: 5 additions & 4 deletions rvm2rbenv.txt
    Original file line number Diff line number Diff line change
    @@ -17,13 +17,16 @@ brew install ruby-build
    git config --global core.excludesfile ~/.gitignore
    printf "vendor/bundle\n.DS_Store\n" >> ~/.gitignore

    # Ignore locally bundled gems
    # Set default bundle path
    mkdir -p ~/.bundle
    printf -- "---\nBUNDLE_PATH: vendor/bundle" >> ~/.bundle/config

    # Instantiate rbenv with your shell (choose preferred file - .profile, .bash_profile, etc)
    # Instantiate rbenv with your shell (choose preferred file - .profile, .bash_profile, .zshrc, etc)
    printf 'eval "$(rbenv init -)"' >> ~/.profile

    # Remove the RVM stuff from your .profile - It probably looks like...
    [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function

    # Reload your profile
    . ~/.profile

    @@ -42,8 +45,6 @@ rbenv install 1.9.2-p290
    rbenv rehash

    # Set the global Ruby version and install bundler globally
    rbenv global 1.9.2-p290
    gem install bundler --pre
    rbenv global 1.9.3-p0
    gem install bundler --pre
    rbenv rehash
  6. Brent revised this gist Nov 22, 2011. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions rvm2rbenv.txt
    Original file line number Diff line number Diff line change
    @@ -13,9 +13,9 @@ brew install ruby-build

    ## Config ####################################################################

    # Ignore version files that rbenv makes, also pesky .DS_Store's
    # Global git ignore
    git config --global core.excludesfile ~/.gitignore
    printf ".rbenv-version\nvendor/bundle\n.DS_Store\n" >> ~/.gitignore
    printf "vendor/bundle\n.DS_Store\n" >> ~/.gitignore

    # Ignore locally bundled gems
    mkdir -p ~/.bundle
  7. Brent revised this gist Nov 22, 2011. 1 changed file with 5 additions and 2 deletions.
    7 changes: 5 additions & 2 deletions rvm2rbenv.txt
    Original file line number Diff line number Diff line change
    @@ -43,11 +43,14 @@ rbenv rehash

    # Set the global Ruby version and install bundler globally
    rbenv global 1.9.2-p290
    gem install bundler
    gem install bundler --pre
    rbenv global 1.9.3-p0
    gem install bundler
    gem install bundler --pre
    rbenv rehash

    # Install any other global gems
    Rails, Heroku, etc

    # Set a project specific ruby version
    cd myproject
    rbenv local 1.9.2-p290
  8. Brent revised this gist Nov 22, 2011. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion rvm2rbenv.txt
    Original file line number Diff line number Diff line change
    @@ -49,7 +49,7 @@ gem install bundler
    rbenv rehash

    # Set a project specific ruby version
    touch ~/projects/newhotness/.rbenv-version
    cd myproject
    rbenv local 1.9.2-p290

    # Install gems in Gemfile to vendor/bundle
  9. Brent revised this gist Nov 22, 2011. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions rvm2rbenv.txt
    Original file line number Diff line number Diff line change
    @@ -41,17 +41,17 @@ rbenv install 1.9.2-p290
    # Rehash rbenv shims (run this after installing binaries)
    rbenv rehash

    # Set the global Ruby version
    # Set the global Ruby version and install bundler globally
    rbenv global 1.9.2-p290
    gem install bundler
    rbenv global 1.9.3-p0
    gem install bundler
    rbenv rehash

    # 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
  10. Brent revised this gist Nov 22, 2011. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion rvm2rbenv.txt
    Original file line number Diff line number Diff line change
    @@ -15,7 +15,7 @@ brew install ruby-build

    # 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
    printf ".rbenv-version\nvendor/bundle\n.DS_Store\n" >> ~/.gitignore

    # Ignore locally bundled gems
    mkdir -p ~/.bundle
  11. Brent revised this gist Nov 21, 2011. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions rvm2rbenv.txt
    Original file line number Diff line number Diff line change
    @@ -27,6 +27,10 @@ printf 'eval "$(rbenv init -)"' >> ~/.profile
    # Reload your profile
    . ~/.profile

    # Add autocompletion to IRB
    touch ~/.irbrc
    printf "require 'irb/completion'" >> ~/.irbrc

    ## Usage #####################################################################
    rbenv

  12. Brent revised this gist Nov 21, 2011. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions rvm2rbenv.txt
    Original file line number Diff line number Diff line change
    @@ -59,4 +59,5 @@ bundle exec rails s
    # 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/...
  13. Brent revised this gist Nov 21, 2011. 1 changed file with 7 additions and 1 deletion.
    8 changes: 7 additions & 1 deletion rvm2rbenv.txt
    Original file line number Diff line number Diff line change
    @@ -53,4 +53,10 @@ cd ~/projects/newhotness
    bundle

    # Start app in context of bundled gems
    bundle exec rails s
    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
    # Note: RubyMine debugger will install some additional needed gems into your global gem path - eg) ~/.gem/ruby/...
  14. Brent created this gist Nov 21, 2011.
    56 changes: 56 additions & 0 deletions rvm2rbenv.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,56 @@
    ## 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