Optimize Ruby Compilation
Ok, so this guy wrote about some CFLAGS you can set when compiling ruby to improve performance and after I did so, I ran into some issue with gems that did not like my new default CFLAGS.
First I re-installed my ruby like so.
$ CC=clang rvm reinstall 1.9.3 --patch falcon
Then I ran $ bundle
and received compilation errors. To get around these errors I did the following for each:
$ gem install <gem_name> -v 'x.x.x' -- --with-cflags="-02 -pipe -march=native -w"
In particular I had issues with debugger-linecache
, eventmachine
, nokogiri
, and therubyracer
.
Written by Ryan Montgomery
Related protips
3 Responses
Sweet!
over 1 year ago
·
Just a fyi the flag on the gem install line says clfags. Humorous, but I don't think that's quite correct :)
over 1 year ago
·
:) Good catch. Thanks!
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#