# Cannot do a universal build of Ruby 1.9.2 on MAC OS X 10.6

**URL:** <https://www.ruby-forum.com/t/cannot-do-a-universal-build-of-ruby-1-9-2-on-mac-os-x-10-6/191365>\
**Category:** Ruby\
**Created:** [July 10, 2010, 1:00pm UTC](https://www.ruby-forum.com/t/cannot-do-a-universal-build-of-ruby-1-9-2-on-mac-os-x-10-6/191365 "2010-07-10T13:00:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zengr](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/ecae2f/32.png) [@zengr](https://www.ruby-forum.com/u/zengr)\
**Post date:** [July 10, 2010, 1:00pm UTC](https://www.ruby-forum.com/t/cannot-do-a-universal-build-of-ruby-1-9-2-on-mac-os-x-10-6/191365/1 "2010-07-10T13:00:16Z")

</div>

Hello,  
I have downloaded ruby-1.9.2-rc1.tar.gz from here:  
ftp://ftp.ruby-lang.org/pub/ruby/

I am trying to build it on 64bit mac osx, 10.6 in 32 bit kernel mode.  
(uname -m gives i386)

I do the following:

1. ./configure --with-arch=x86\_64,i386 —\> a universal build
2. Make —\> gives error

…  
ld: warning: in utf\_8.o, file was built for i386 which is not the  
architecture being linked (x86\_64)  
ld: warning: in newline.o, file was built for i386 which is not the  
architecture being linked (x86\_64)  
Undefined symbols:  
“\_main”, referenced from:  
start in crt1.10.6.o  
ld: symbol(s) not found  
collect2: ld returned 1 exit status  
make: \*\*\* [miniruby] Error 1

Any idea why?

Thanks

Reference:

> <https://stackoverflow.com/questions/3137840/how-to-manually-build-a-universal-ruby-on-mac-os-x-how-about-with-rvm>

---

<div class="post-metadata">

**Author:** ![zengr](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/ecae2f/32.png) [@zengr](https://www.ruby-forum.com/u/zengr)\
**Post date:** [July 10, 2010, 5:13pm UTC](https://www.ruby-forum.com/t/cannot-do-a-universal-build-of-ruby-1-9-2-on-mac-os-x-10-6/191365/2 "2010-07-10T17:13:07Z")

</div>

It’s because the step that builds libruby.dylib doesn’t care about your  
-arch flag settings. I use this patch:

[http://github.com/jameskilton/rvm/blob/7753bcc7c3b6da8d61900efb41f538824b0dc3c0/patches/ruby/1.8.7/osx-arch-fix.patch](http://github.com/jameskilton/rvm/blob/7753bcc7c3b6da8d61900efb41f538824b0dc3c0/patches/ruby/1.8.7/osx-arch-fix.patch)

to allow me to specify what architecture to built. If this works for a  
universal binary I’d love to know, but last I checked I could still only  
build for a single arch.

Jason
