-
Notifications
You must be signed in to change notification settings - Fork 369
Ruby on MacOS
recommended => ruby 2.2 # or the most recent version
minimum => ruby 2.0
Both Yosemite (10.10) and El Capitan (10.11) ship with ruby 2.0 pre-installed. We recommend you install and use a ruby manager on MacOS because Apple's version is always several steps behind the most recent version. More importantly, by default, Apple's version requires sudo
to install gems.
You should never install a gem with sudo.
During installation, a gem can execute arbitrary commands. This means a gem installed with sudo
could wipe your entire hard drive, upload private data to a server, or install malware on your machine.
Here are some examples of malicious gems. Don't try these!
Still not convinced that MacOS system ruby is a bad idea?
If you must use Calabash with Apple's system ruby, please follow these excellent instructions to configure your ruby environment.
The Calabash team at Xamarin uses both rbenv and rvm. We prefer rbenv because rvm users have reported issues installing the Calabash toolchain.
rbenv is a system for managing ruby versions.
You can also install rbenv with homebrew.
rvm is another ruby management system.
There are many users who use rvm with success, but we have had some users report problems using rvm + Calabash iOS.
$ gem source -r http://gems.rubyonrails.org
http://gems.rubyonrails.org removed from sources
Avoid installing documentation:
# Create a ~/.gemrc with the following:
install: --no-document --env-shebang
update: --no-document --env-shebang
Bundler maintains a consistent environment for ruby applications. It tracks an application's code and the rubygems it needs to run, so that an application will always have the exact gems (and versions) that it needs to run.
We recommend that you always use a Gemfile and bundler.