New to the RoR world view and just learning about gems - I've hit a
snag installing two separate gems that I can't seem to get past with
one of them.
My environment is osX 10.5.4 on a ppc processor. I have gcc 4.1 (and
related tools) installed as well as mysql-5.0.51a. ruby --version =>
ruby 1.8.6 (2008-03-03 patchlevel 114) [universal-darwin9.0] and rails
--version => Rails 2.1.0.
My problem has been with the RMagick and MySQL gems, and is related to
these gems attempting to build for both the ppc and 386 architectures
via --arch options for both appearing in the gcc command that is
generated during the install process.
I was able to step around the problem with RMagick by editing the
options out of the generated makefile, doing the make directly. Not
too satisfying but it did build, test, and install. No such luck with
the MySQL gem however.
Any thoughts or suggestions? Where / how is the makefile generated?
Who decided that I wanted both architectures build for a ppc only
environment? Is it even possible to build a foreign arch without a
cross compiler?
ruby generates the makefile (via extconf.rb, ie mkmf). The problem
you've got is that since you've got a universal build of ruby it's
trying to build universal extensions.
See also Perl, Python, and Ruby Extensions Release Notes
(i know it says perl extensions, but it applies to ruby too)
Surprise, you've got a cross compiler: a ppc mac can build i386
binaries and vice-versa.
export ARCHFLAGS='-arch ppc'
sudo gem install mysql
it's going to cook for a while so...
Yes, I know that gcc can be built as a cross compiler but I'm not
particularly interested in dedicating time/space to building for a
system I don't have.
cooking's done, more burned toast.
same -arch ppc -arch i386 failure that looks like this: