Any help is welcome.
Thanks,
-- Chad
What version of mysql is installed? is a universal binaries or is 64bits one?
What architecture is the Ruby compiled by RVM? (file `which ruby`)
--
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry
Thanks for your help Luis.
>
> What version of mysql is installed? is a universal binaries or is 64bits one?
http://gist.github.com/456916#file_2. my_sql info
>
> What architecture is the Ruby compiled by RVM? (file `which ruby`)
>
http://gist.github.com/456916#file_3. ruby info
Why are some libraries under MySQL x86_64 arch, when mysql status
reports i386 as the arch?
Also, I can't seem to force the mysql_api.bundle to be i386 arch, even
if I pass env ARCHFLAGS="-arch i386" when building the gem. Not sure
what mkmf is doing...
Solved this. Root cause was that RVM/Ruby had compiled for i386
architecture rather than x86_64:
http://gist.github.com/456916#file_6._solved
Thanks for the help...
-- Chad
RVM doesn't 'specifically use' a given architecture, instead it leaves
that choice up to your OS and the compiler you are using.
Right. I found this out by digging into the ruby configure logic to
detect the architecture before I just tried reinstalling. No idea how
ruby detected a wrong platform - maybe I did the faulty install from a
terminal session which happened to have ARCHFLAGS set to '-arch i386'
from some previous process.
One thing I did realize - there are parts of the ruby configure/make
process (ones which use "cc" instead of "gcc") in which the
architecture CANNOT be overridden (e.g. to make a universal binary)
unless you manually edit the generated Makefile. Looks like an
oversight.
-- Chad
Wayne,
Actually, I think logic in RVM may have been responsible for this. My
clue was the following comment on my gist:
' I usually put this line in my root .rvmrc file to always compile in
x86_64: export rvm_archflags="-arch x86_64" ' - From: spagalloco
That made me wonder what RVM did with rvm_archflags, which led me to
this line in RVM:
http://github.com/wayneeseguin/rvm/blob/master/scripts/utility#L515
In the case of my macbook, `sysctl hw.cpu64bit_capable` returns zero,
even though I am running snow leopard and (as I painfully found out)
need to set my -arch to x86_64 whenever I compile something.
Haven't dug into it, but this definitely seems like it could have been
the cause of my ruby incorrectly compiling for i386 architecture.
-- Chad
Today I tried it again, and sysctl hw.optional.x86_64 returns 1 now.
My machine must be schizo, but that supports the behavior I saw...
Wow, this is very fascinating... I have added that to my notes thanks.
> Thanks to everyone on this email list, especially Wayne. Everyone has
> been extremely helpful.
You are most welcome of course :)
Is the logical thing to always compile 64 bit if snow leopard is
detected? Is it even possible to run snow leopard i386?
That said, I definitely think the best route is to run 64 bits at all
times if possible.
This does not work on older macbooks like mine.
--
Please visit http://rvm.beginrescueend.com/ for documentation on rvm.
Please visit https://www.pivotaltracker.com/projects/26822 to see what is being worked on currently.
You received this message because you are subscribed to the Google
Groups "rvm (Ruby Version Manager)" group.
To post to this group, send email to rubyversi...@googlegroups.com
To unsubscribe from this group, send email to
rubyversionmana...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyversionmanager?hl=en