Skip to content

Instantly share code, notes, and snippets.

@alloy
Last active December 11, 2015 18:38
Show Gist options
  • Save alloy/4642480 to your computer and use it in GitHub Desktop.
Save alloy/4642480 to your computer and use it in GitHub Desktop.
language: objective-c
env:
# This is what 10.8.x comes with and we want to support that.
- RVM_RUBY_VERSION=system NOEXEC_DISABLE=1 RUBY_VERSION_SPECIFIC='sudo gem update --system && sudo gem install bundler --no-ri --no-rdoc'
- RVM_RUBY_VERSION=1.9.3 NOEXEC_DISABLE=1 RUBY_VERSION_SPECIFIC='sudo ln -s /usr/bin/llvm-gcc-4.2 /usr/bin/gcc-4.2 && curl http://curl.haxx.se/ca/cacert.pem -o /usr/local/share/cacert.pem' SSL_CERT_FILE=/usr/local/share/cacert.pem
before_install: source ~/.rvm/scripts/rvm && rvm use $RVM_RUBY_VERSION
install: eval $RUBY_VERSION_SPECIFIC && rake bootstrap
script: bundle exec rake spec:ci

The nice thing about having a real OS X installation is that I can run the test suite against that too and be ensured that I did not break anything for others while developing on a faster newer Ruby myself. Therefore, it would be great if the system Ruby gets some love in the form of:

The pre-installed (with RVM) Ruby 1.9.3 version has a couple of issues:

  • The RVM version installed is outdated (I think) and does not support the --fuzzy flag etc.
  • I need to source ~/.rvm/scripts/rvm myself, otherwise I get: RVM is not a function, selecting rubies with 'rvm use ...' will not work.. This probably means the profile of the user running the build is missing the required RVM setup.
  • I need to configure OpenSSL to use a valid root CA file, as described in this comment, otherwise it won’t be able to verify connections.
  • I need to symlink /usr/bin/gcc-4.2 to /usr/bin/llvm-gcc-4.2, otherwise this happens. Note that this not a RVM issue perse, it will probably occur while installing other tools as well.
@joshk
Copy link

joshk commented Jan 26, 2013

The build script sources .profile, so it is a good place to put symlinks and stuff

@joshk
Copy link

joshk commented Jan 26, 2013

Good point about RVM

@sarahhodne
Copy link

I have not changed anything on the VMs, this is how they were when I first started working on them. I did notice the MacPorts/Fink warning.

So, when I figure out how to update the VMs, here's what I think I'll do:

  • Update RVM and add it to .profile
  • Update system RubyGems and install bundler
  • Uninstall MacPorts and/or Fink
  • Set RVMs default ruby to be the system ruby
  • Preinstall Ruby 1.8.7 and 1.9.3
  • Update Xcode

Eventually, I'll also look into preinstalling CocoaPods and run pod setup so we have the spec repo cloned and all.

Anything you think I should add/remove?

@sarahhodne
Copy link

Michal Papis just told me that llvm really shouldn't be used to compile rubies or gems. See this ruby bug.

@mpapis
Copy link

mpapis commented Jan 27, 2013

@joshk - rvm by default installs latest rubygems/bundler, as for homebrew you can run: rvm requirements run force ruby - it wll detect hombrew and install what is required for ruby - replace the last argument with what you need

@alloy
Copy link
Author

alloy commented Jan 30, 2013

Oops, didn’t see the newer messages.

@henrikhodne That list sounds excellent.

Regarding the LLVM issue, it’s true that older Rubies will have problems, but since 1.9.3-p125 it should work (see the release notes: http://www.ruby-lang.org/en/news/2012/02/16/ruby-1-9-3-p125-is-released/).

/cc @mpapis

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