On 2 Mar 2009, at 4:22pm, Robert Walker wrote:

>
> Robert Walker wrote:
>> # On Mac OS X Leopard:
>> #   sudo env ARCHFLAGS="-arch i386" gem install mysql --
>> --with-mysql-config=/usr/local/mysql/bin/mysql_config
>> #       This sets the ARCHFLAGS environment variable to your native
>> architecture
>
> I just realized that the command I posted earlier was missing the  
> extra
> -- after mysql and before --with-my...
>
> So make sure you use the command exactly as above and it should work
> fine. If you happen to have a PowerPC based mac running leopard, be  
> sure
> to switch out -i386 with -ppc.


OK, sorted. Thanks for all of your help. Here, for the record, is what  
I did, based on your collected suggestions:

1. I ran this command (all on one line):
sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql- 
config=/usr/local/mysql/bin/mysql_config


2. I did the install_name_tool thing (also all on one line - note the  
paths carefully - the first is the wrong path, the second is the  
correct path and the third should also be correct):
sudo install_name_tool -change /usr/local/mysql/lib/mysql/ 
libmysqlclient.15.dylib /usr/local/mysql/lib/libmysqlclient.15.dylib

3. To test, I created a new mysql project, changed to the project  
folder, edited the username and password in config/database.yml and  
then typed rake db:create:all. This just returned the command prompt  
with no error.


Here is the transcript:

==== transcript ====

frost:rails ian$ sudo env ARCHFLAGS="-arch i386" gem install mysql --  
--with-mysql-config=/usr/local/mysql/bin/mysql_config
Building native extensions.  This could take a while...
Successfully installed mysql-2.7
1 gem installed

frost:rails ian$ sudo install_name_tool -change /usr/local/mysql/lib/ 
mysql/libmysqlclient.15.dylib /usr/local/mysql/lib/libmysqlclient. 
15.dylib /Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/mysql.bundle

frost:rails ian$ rails -d mysql dbtest

frost:rails ian$ cd dbtest

frost:dbtest ian$ rake db:create:all


==== transcript ====



Ian.
--

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to