The calabash-sandbox
tool is no longer maintained. You can still use the
sandbox, but the ruby version and the base Gemfile will not be updated.
To keep your gems up to date, use bundler and Gemfile.
We recommend that you use rbenv installed with homebrew.
https://github.com/calabash/calabash-ios/wiki/Ruby-on-MacOS
$ cd ~/my/project
# Update your Gemfile to point to the version of the gems you want.
# gem "calabash-cucumber", "0.20.5"
# gem "calabash-android", "0.9.1"
$ calabash-sandbox
[me@calabash-sandbox]$ bundle update
Calabash Sandbox requires one of the following operating systems:
- macOS El Cap
- macOS Sierra
- Windows 10
The sandbox is not officially supported on other OS versions.
If you already have rbenv or rvm installed, then this repo is not for you.
See System Requirements above.
$ curl -sSL https://raw.githubusercontent.com/calabash/install/master/install-osx.sh | bash
In an administrator Powershell:
set-executionpolicy unrestricted
then
(New-Object System.Net.WebClient).DownloadString("https://raw.githubusercontent.com/calabash/install/master/install-windows.ps1") | iex
Post-installation, execute the following in an administrator Powershell:
set-executionpolicy restricted
When installation completes, you should see something like the following:
Done! Installed:
calabash-android: 0.8.2
xamarin-test-cloud: 2.0.2
Execute 'calabash-sandbox' to get started!
You can execute calabash-sandbox update
at any time to fetch the latest gems.
When you execute calabash-sandbox
, your Terminal window will open the
sandbox environment. To leave the sandbox and return the terminal to its
previous state, simply type exit
.
While in the sandbox, you will have access to all of the gems you need to start writing tests and submitting to Test Cloud. To get started, you could run
$ calabash-ios gen #OSX only
or
$ calabash-android gen
For more information on Calabash, please see the Calabash documentation.
By default, the sandbox will ignore any existing ruby setup you have on your
machine, including installed gems. The sandbox shell is launched with a PATH
,
GEM_PATH
, and GEM_HOME
that reference the pre-configured sandbox environment
(which is installed to $HOME/.calabash/sandbox
).
If you install new gems while running in the sandbox, they will be installed
in the sandbox's GEM_HOME
and thus not be available outside of the sandbox.
When installing gems that build native extensions on Windows you may get the following error:
ERROR: Failed to build gem native extension.
To resolve this you must provide the Calabash sandbox installation of ruby with the RubyInstaller Development Kit:
- Download DevKit from http://rubyinstaller.org/downloads/ making sure you get the version for 32bit versions of Ruby 2.0 and above
- Install DevKit into
C:\DevKit
- Launch the Calabash sandbox
calabash-sandbox
- Execute
cd C:\DevKit\ && ruby dk.rb init
- Add the following line (replacing
<user>
with your user directory) toC:\DevKit\config.yml
if it doesn’t already exist:- C:\Users\<user>\.calabash\sandbox\Rubies\ruby-2.1.6-p336
- Execute
ruby dk.rb install
If you have altered your sandbox environment in a way you don't like and want to restore it to the original state, just run these commands:
$ rm -r ${HOME}/.calabash/sandbox
$ curl -sSL https://raw.githubusercontent.com/calabash/install/master/install-osx.sh | bash
In a powershell,
rm -r -fo "${env:USERPROFILE}\.calabash\sandbox"
In an administrator Powershell:
set-executionpolicy unrestricted
then
(New-Object System.Net.WebClient).DownloadString("https://raw.githubusercontent.com/calabash/install/master/install-windows.ps1") | iex
Post-installation, execute the following in an administrator Powershell:
set-executionpolicy restricted
This is a common error on a fresh install of OSX.
The script attempts to install the sandbox executable to /usr/local/bin
so that
it can be easily invoked from the command line. However, if you don't have
write permissions in that dir, the install script will not be able to move
the script there. You can still run it locally by executing
$ ./calabash-sandbox
from the same directory as you ran the install script.
If you'd like to install it globally, either have an administrator move the
calabash-sandbox
executable to somewhere in your PATH
or modify your
.bash_profile
, .profile
, .zsh
etc. to find calabash-sandbox
in your
PATH
. You should not run the install script with sudo
.
$ sudo rm -r ${HOME}/.calabash/sandbox
$ sudo rm -f /usr/local/bin/calabash-sandbox
$ sudo rm -f ./calabash-sandbox
Run the install script again, this time without sudo.