Calabash cucumber: command not found - cucumber not in /usr/bin

1.4k Views Asked by At

I have an issue with cucumber. I've reviews all of the other StackOverflow answers and none of them exactly match my own scenario.

I'm running the following line of code in a Unix script, which should run Calabash Cucumber (to allow Calabash to drive the iOS simulator on Mac OSX:

DEVICE_TARGET='iPhone 5s (9.1)' APP=./myapp.app cucumber

I get the following error when the above line runs:

cucumber: command not found

The issue seems to be that cucumber isn't installed into the root /usr/bin folder (this doesn't contain a 'cucumber' folder as expected). I install calabash cucumber using

sudo gem install calabash-cucumber -v 0.16.4

I can see that I have cucumber itself installed in /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.19/bin, and I've added that to my path by editing my .bash_profile, and the 'cucumber' command then works, however for the system I'm working on I get a whole set of different errors, since cucumber is really expected to be available in the /usr/bin directory.

I've installed calabash cucumber on other computers (running El Capitan, the same OS that I have the problem with), and cucumber is successfully installed into /usr/bin.

Uninstalling and re-installing calabash-cucumber doesn't work. What can I do to ensure cucumber is installed into /usr/bin? I suspect this is somehow permissions related (and I've disabled system integrity checking on the machine, however, this makes no difference).

2

There are 2 best solutions below

1
On

I fixed this by removing all existing versions of cucumber gems from my system (I needed to remove these from /Library/Ruby/Gems/2.0.0/gems/), using:

sudo gem uninstall cucumber -v 1.3.18 (or whatever version number you're using)

then I re-installed Calabash Cucumber using:

sudo gem install calabash-cucumber -v 0.16.4

The latest version of Cucumber was then successfully installed in /usr/bin, and everything now works.

0
On

Starting with Xcode 8.0 and/or macOS Sierra, Calabash no longer supports using the Apple system ruby.

We recommend using rbenv.

Here is some documentation: