5

I wrote some ruby script, that uses CocoaPods/Xcodeproj to edit xcode project file.

This script executes from xcode build phase script:

ruby script.rb someProj.xcodeproj

Inside ruby script, there is a 'require' for xcodeproj:

require 'xcodeproj'

When I invoke this script manually from terminal, everything is ok.

But when it invokes from xcode build phase, ruby throws exception:

cannot load such a file xcodeproj (something like that)

What am I missing?

Nikita
  • 1,811
  • 1
  • 20
  • 41

1 Answers1

9

Build phase -> Shell: change /bin/sh to /bin/bash -l Bash login is required, in order to load ruby variables/paths/etc.

Nikita
  • 1,811
  • 1
  • 20
  • 41