3

I am trying to integrate ruby script (fastlane tool) and call it in run phase in xcode, something like this:

fastlane xcode_run_phase

It runs well in my terminal, but in xcode I get the following error :

/Library/Ruby/Gems/2.0.0/gems/fastlane-1.53.0/lib/fastlane/fast_file.rb:20:in `tr!': incompatible character encodings: US-ASCII and UTF-8 (Encoding::CompatibilityError)

Xcode is running it in some weird mode, which breaks ruby encoding. I tried forcing

#!/usr/bin/env bash 

or forcing different rvm like here: Use rvm to force specific Ruby in Xcode Run Script build phase with no luck.

Any idea how to force xcode to run the script in normal mode, like in terminal?

Thanks

Community
  • 1
  • 1
Tomáš Kohout
  • 755
  • 6
  • 15

1 Answers1

1

In the end the solution seems to be to force UTF8 onto ruby

LC_ALL= LANG=en_US.UTF-8 ruby -e 'p Encoding.default_external'
export LANG=en_US.UTF-8
Tomáš Kohout
  • 755
  • 6
  • 15