Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Atastor/2e85ee4fab03aaab391594b6fa769931 to your computer and use it in GitHub Desktop.
Save Atastor/2e85ee4fab03aaab391594b6fa769931 to your computer and use it in GitHub Desktop.
Monkeypatching RubyMotion + CocoaPods + Mojave (potential base for a REAL fix)
# The following assumes that you have rbenv and rbenv's ruby version 2.3.7 installed.
# Please only do the following, if you know what you are doing.
# It might be best to wait for the official bugfix either from Apple or from Amir :-)
# WARNING: On my quest I might have made unnoticed use of abandoned attempts side effects ...
# So if you have trouble to make this work, contact me
#
# Check, whether /usr/include exists on your Mojave
# If not, follow https://apple.stackexchange.com/questions/337940/why-is-usr-include-missing-i-have-xcode-and-command-line-tools-installed-moja?newreg=68e416bca5774b52adfc675cbdf46620
# i.e. summarized:
sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
#
# I had trouble with the system ruby, so lets use rbenv ruby 2.3.7
#
rbenv local 2.3.7
# Do whatever you like to do with your new rubys; for me its
gem update --no-doc --system
gem update --no-doc
#
# Get BridgeSupport sources; checkout out an old commit; compile and install
# This should give you a working gen_bridge_metadata again.
#
git clone https://github.com/HipByte/BridgeSupport.git
cd BridgeSupport
# The following commit was chosen to get a quite safe point to bisect later
git checkout f5061ef35d71d090b2abff20abb3318e507f7279
make
pushd /Library/RubyMotion/lib/
sudo mv BridgeSupport2 BridgeSupport2-ORIGINAL
sudo mkdir BridgeSupport2
popd
sudo make install DESTDIR=/Library/RubyMotion/lib/BridgeSupport2
#
# Ancient reported but still not fixed bug: https://trac.macports.org/ticket/54939
# i.e. summarized:
sudo mkdir -p /usr/local/lib/
sudo ln -s "$(xcode-select -p)/Toolchains/XcodeDefault.xctoolchain/usr/lib/libclang.dylib" /usr/local/lib/
# After that a reboot might be necessary. Then you should be ready to use cocoapods in RubyMotion in Mojave based Macs.
@skovsboll
Copy link

Thanks for sharing this. It worked for me 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment