Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Use rbenv to change Ruby versions #70

Closed
wants to merge 8 commits into from

5 participants

@croaky
Owner
  • Use Homebrew consistently for OS programs.
  • Use ruby-build to install Rubies.
  • Include auto-switching of Ruby in ~/.zlogin.
  • Install latest stable version of Ruby (2.0).
  • Upgrade Rubygems after Ruby is installed. This is to help avoid common Bundler/Psych issues: tenderlove/psych#66
  • Use Bundler prerelease version for now in order to work with latest Rubygems on Ruby 2.0.
@croaky croaky Use rbenv to change Ruby versions
* Use Homebrew consistently for OS programs.
* Use ruby-build to install Rubies.
* Include auto-switching of Ruby in `~/.zlogin`.
* Install latest stable version of Ruby (2.0).
* Upgrade Rubygems after Ruby is installed. This is to help avoid common
  Bundler/Psych issues:
  tenderlove/psych#66
* Use Bundler prerelease version for now in order to work with latest
  Rubygems on Ruby 2.0.
9b7e2c3
mac
((27 lines not shown))
echo "Installing critical Ruby gems for Rails development ..."
- successfully gem install bundler rails pg foreman thin --no-rdoc --no-ri
+ successfully gem install bundler --pre --no-rdoc --no-ri
@gylaz Owner
gylaz added a note

With rubygems 2.0 we can just use --no-document

From release docs:

  • Added –document to replace –rdoc and –ri. Use –no-document to disable documentation, –document=rdoc to only generate rdoc
@croaky Owner
croaky added a note

@gylaz Nice. I didn't know about that. Done in 8ae8726.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
mac
@@ -60,15 +60,27 @@ echo "Installing QT, used by Capybara Webkit for headless Javascript integration
echo "Installing watch, used to execute a program periodically and show the output ..."
successfully brew install watch
-echo "Installing RVM (Ruby Version Manager) and Ruby 1.9.3-p327, which becomes the default ..."
- successfully curl -L https://get.rvm.io | bash -s stable --ruby
- successfully echo "
-# RVM
-[[ -s '/Users/`whoami`/.rvm/scripts/rvm' ]] && source '/Users/`whoami`/.rvm/scripts/rvm'" >> ~/.zshenv
- successfully source ~/.rvm/scripts/rvm
+echo "Installing rbenv for changing Ruby versions ..."
+ successfully brew install rbenv
+
+echo "Installing ruby-build for installing Rubies ..."
+ successfully brew install ruby-build
+ successfully echo 'eval "$(rbenv init -)"' >> ~/.zlogin
+ successfully source ~/.zlogin
@gylaz Owner
gylaz added a note

Should the above two lines live right after brew install rbenv?

@croaky Owner
croaky added a note

@gylaz Yup, thanks. Done in cf60d44.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@gabebw gabebw commented on the diff
@@ -60,15 +60,27 @@ echo "Installing QT, used by Capybara Webkit for headless Javascript integration
echo "Installing watch, used to execute a program periodically and show the output ..."
successfully brew install watch
-echo "Installing RVM (Ruby Version Manager) and Ruby 1.9.3-p327, which becomes the default ..."
- successfully curl -L https://get.rvm.io | bash -s stable --ruby
- successfully echo "
-# RVM
-[[ -s '/Users/`whoami`/.rvm/scripts/rvm' ]] && source '/Users/`whoami`/.rvm/scripts/rvm'" >> ~/.zshenv
- successfully source ~/.rvm/scripts/rvm
+echo "Installing rbenv for changing Ruby versions ..."
+ successfully brew install rbenv
@gabebw Owner
gabebw added a note

Let's brew install rbenv-gem-rehash too. That way people don't ever need to run rbenv rehash after installing something with a CLI binary. It's simple, convenient, and lets the developer focus on more important things.

@croaky Owner
croaky added a note

Yeah, I saw @jferris and @trevororeilly say this works well. Do I brew install here? If I do, can I remove rbenv rehash on line 76?

@croaky Owner
croaky added a note

Done in 4358b26.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@mjankowski
Owner

There were new bundler versions released earlier today -- do those solve the issues there, or do you still need the prerelease?

mac
@@ -60,15 +60,27 @@ echo "Installing QT, used by Capybara Webkit for headless Javascript integration
echo "Installing watch, used to execute a program periodically and show the output ..."
successfully brew install watch
-echo "Installing RVM (Ruby Version Manager) and Ruby 1.9.3-p327, which becomes the default ..."
- successfully curl -L https://get.rvm.io | bash -s stable --ruby
- successfully echo "
-# RVM
-[[ -s '/Users/`whoami`/.rvm/scripts/rvm' ]] && source '/Users/`whoami`/.rvm/scripts/rvm'" >> ~/.zshenv
- successfully source ~/.rvm/scripts/rvm
+echo "Installing rbenv for changing Ruby versions ..."
+ successfully brew install rbenv
+ successfully echo 'eval "$(rbenv init -)"' >> ~/.zlogin
+ successfully source ~/.zlogin
+
+echo "Installing ruby-build for installing Rubies ..."
+ successfully brew install ruby-build
+
+echo "Installing Ruby 2.0.0-p0 ..."
@gabebw Owner
gabebw added a note

Install latest stable version of Ruby

Is this really stable? It was released a couple days ago. I'd feel more comfortable installing the latest 1.9.3 and 2.0.0-p0, and setting 1.9.3 as the default.

@calebthompson Owner

There are issues with rubygems and 2.0. I wouldn't use this yet. Give it a couple weeks.

It looks like there are some issues with OpenSSL certs and Ruby 2.0. If I were you, I’d wait a few days for things to get sorted.
https://twitter.com/wycats/status/305817088012996609

@croaky Owner
croaky added a note

Agreed. I got excited. Changed in ae7e4df.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
croaky added some commits
@croaky croaky Use Bundler 1.3.0 now that it is released
Remove `--pre` flag.
968d7dc
@croaky croaky Use Ruby 1.9.3-p392
Use 1.9.2 until we've given 2.0.0 more of a chance in production
environments.
ae7e4df
@croaky
Owner

@mjankowski Nice. No, we don't need the prerelease any more. Thanks. Updated in 968d7dc.

mac
@@ -60,15 +60,28 @@ echo "Installing QT, used by Capybara Webkit for headless Javascript integration
echo "Installing watch, used to execute a program periodically and show the output ..."
successfully brew install watch
-echo "Installing RVM (Ruby Version Manager) and Ruby 1.9.3-p327, which becomes the default ..."
- successfully curl -L https://get.rvm.io | bash -s stable --ruby
- successfully echo "
-# RVM
-[[ -s '/Users/`whoami`/.rvm/scripts/rvm' ]] && source '/Users/`whoami`/.rvm/scripts/rvm'" >> ~/.zshenv
- successfully source ~/.rvm/scripts/rvm
+echo "Installing rbenv for changing Ruby versions ..."
+ successfully brew install rbenv
+ successfully echo 'eval "$(rbenv init -)"' >> ~/.zlogin
+ successfully source ~/.zlogin
+
+echo "Installing rbenv-gem-rehash so the shell automatically picks up binareis after installing gems with binaries..."
@gabebw Owner
gabebw added a note

The first "binaries" is misspelled.

@croaky Owner
croaky added a note

Thanks, fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@gabebw
Owner

:sparkles: :+1: :sparkles:

@croaky croaky closed this
@croaky
Owner

Thanks, @gabebw. Squashed and merged. Also reverted the --no-document change after going back to 1.9.3.

@gylaz gylaz commented on the diff
((29 lines not shown))
echo "Installing critical Ruby gems for Rails development ..."
- successfully gem install bundler rails pg foreman thin --no-rdoc --no-ri
@gylaz Owner
gylaz added a note

You can still use --no-document here, since we're doing gem update --system a few lines above, which will update rubygems to 2.0. Also --no-document still exists on the line below :smiley_cat:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 24, 2013
  1. @croaky

    Use rbenv to change Ruby versions

    croaky authored
    * Use Homebrew consistently for OS programs.
    * Use ruby-build to install Rubies.
    * Include auto-switching of Ruby in `~/.zlogin`.
    * Install latest stable version of Ruby (2.0).
    * Upgrade Rubygems after Ruby is installed. This is to help avoid common
      Bundler/Psych issues:
      tenderlove/psych#66
    * Use Bundler prerelease version for now in order to work with latest
      Rubygems on Ruby 2.0.
  2. @croaky
Commits on Feb 25, 2013
  1. @croaky
  2. @croaky
  3. @croaky

    Use Bundler 1.3.0 now that it is released

    croaky authored
    Remove `--pre` flag.
  4. @croaky

    Use Ruby 1.9.3-p392

    croaky authored
    Use 1.9.2 until we've given 2.0.0 more of a chance in production
    environments.
  5. @croaky

    Use rbenv-gem-rehash

    croaky authored
  6. @croaky

    Fix spelling error

    croaky authored
This page is out of date. Refresh to see the latest.
Showing with 22 additions and 9 deletions.
  1. +22 −9 mac
View
31 mac
@@ -29,8 +29,8 @@ echo "Installing GNU Compiler Collection and dependencies ..."
successfully brew tap homebrew/dupes
successfully brew install autoconf automake apple-gcc42
-echo "Installing libksba, recommended for Ruby 1.9.3 ..."
- successfully brew install libksba
+echo "Installing system libraries recommended for Ruby ..."
+ successfully brew install gdbm libffi libksba libyaml
echo "Installing Postgres, a good open source relational database ..."
successfully brew install postgres --no-python
@@ -60,15 +60,28 @@ echo "Installing QT, used by Capybara Webkit for headless Javascript integration
echo "Installing watch, used to execute a program periodically and show the output ..."
successfully brew install watch
-echo "Installing RVM (Ruby Version Manager) and Ruby 1.9.3-p327, which becomes the default ..."
- successfully curl -L https://get.rvm.io | bash -s stable --ruby
- successfully echo "
-# RVM
-[[ -s '/Users/`whoami`/.rvm/scripts/rvm' ]] && source '/Users/`whoami`/.rvm/scripts/rvm'" >> ~/.zshenv
- successfully source ~/.rvm/scripts/rvm
+echo "Installing rbenv for changing Ruby versions ..."
+ successfully brew install rbenv
@gabebw Owner
gabebw added a note

Let's brew install rbenv-gem-rehash too. That way people don't ever need to run rbenv rehash after installing something with a CLI binary. It's simple, convenient, and lets the developer focus on more important things.

@croaky Owner
croaky added a note

Yeah, I saw @jferris and @trevororeilly say this works well. Do I brew install here? If I do, can I remove rbenv rehash on line 76?

@croaky Owner
croaky added a note

Done in 4358b26.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ successfully echo 'eval "$(rbenv init -)"' >> ~/.zlogin
+ successfully source ~/.zlogin
+
+echo "Installing rbenv-gem-rehash so the shell automatically picks up binaries after installing gems with binaries..."
+ successfully brew install rbenv-gem-rehash
+
+echo "Installing ruby-build for installing Rubies ..."
+ successfully brew install ruby-build
+
+echo "Installing Ruby 1.9.3-p392 ..."
+ successfully rbenv install 1.9.3-p392
+
+echo "Setting Ruby 1.9.3-p392 as global default Ruby ..."
+ successfully rbenv global 1.9.3-p392
+
+echo "Update to latest Rubygems version ..."
+ successfully gem update --system
echo "Installing critical Ruby gems for Rails development ..."
- successfully gem install bundler rails pg foreman thin --no-rdoc --no-ri
@gylaz Owner
gylaz added a note

You can still use --no-document here, since we're doing gem update --system a few lines above, which will update rubygems to 2.0. Also --no-document still exists on the line below :smiley_cat:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ successfully gem install bundler foreman pg rails thin --no-document
echo "Installing standalone Heroku CLI client."
successfully brew install heroku-toolbelt
Something went wrong with that request. Please try again.