Hi ho. Am having sooooo much fun trying to get MySQL to talk to Rails. Yes, I''m getting "Permission denied - /usr/lib/ruby/gems/1.8/cache/ mysql-2.6.gem" I''ve tried practically everything I can think of. Yes, I''ve stopped MySQL server Yes, I''ve run the update script from tech.rufy... I''ve even flattened the bloody G5, re-installed from the DVD... (Oh joy) ... updated to 10.4.2 ... ... installed MySQL 4.1.13... If I try running ''sudo gem install mysql'' i can get past the ''Permission denied -'' message, but then I get... Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/ mysql-2.6 for inspection. ruby extconf.rb install mysql\nchecking for mysql_query() in - lmysqlclient... no checking for main() in -lm... yes checking for mysql_query() in -lmysqlclient... no checking for main() in -lz... yes checking for mysql_query() in -lmysqlclient... no checking for main() in -lsocket... no checking for mysql_query() in -lmysqlclient... no checking for main() in -lnsl... no checking for mysql_query() in -lmysqlclient... no What is going on. I have no hair left to tear out. R
On 8/18/05, Richard Dyce <dickiedyce-ee4meeAH724@public.gmane.org> wrote:> Hi ho. > > Am having sooooo much fun trying to get MySQL to talk to Rails. > > Yes, I''m getting "Permission denied - /usr/lib/ruby/gems/1.8/cache/ > mysql-2.6.gem" > > I''ve tried practically everything I can think of.There''s a wiki page that has a lot of notes compiled on this very subject: http://wiki.rubyonrails.com/rails/show/HowtoInstallOnOSXTiger Try something like this: sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql (yes the middle -- is important) -- rick http://techno-weenie.net
I find that using sudo for installing all gems is the best way to avoid problems. Rasheq On 8/18/05, Rick Olson <technoweenie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > On 8/18/05, Richard Dyce <dickiedyce-ee4meeAH724@public.gmane.org> wrote: > > Hi ho. > > > > Am having sooooo much fun trying to get MySQL to talk to Rails. > > > > Yes, I''m getting "Permission denied - /usr/lib/ruby/gems/1.8/cache/ > > mysql-2.6.gem" > > > > I''ve tried practically everything I can think of. > > There''s a wiki page that has a lot of notes compiled on this very > subject: http://wiki.rubyonrails.com/rails/show/HowtoInstallOnOSXTiger > > Try something like this: sudo gem install mysql -- > --with-mysql-dir=/usr/local/mysql > (yes the middle -- is important) > > > -- > rick > http://techno-weenie.net > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Richard Dyce wrote:> Hi ho. > > Am having sooooo much fun trying to get MySQL to talk to Rails.hi richard~ i just got this working on my powerbook yesterday -- after much hand-wringing action. since i still have the iterm open, here''s the scrollback redux: my problem was with the mysql-ruby binding version. using the beta from http://tmtm.org/en/mysql/ruby/ and following his instructions i had success make sure to do a ''sudo'' on make install ;) ps: i''m using mysql 4.1.13 hope this helps, feel free to ask if you have any problems -jd
Rick, Yes, I''ve tried http://wiki.rubyonrails.com/rails/show/HowtoInstallOnOSXTiger and making sure I''ve got the right path for mysql Can anyone actually tell me what -lmysqlclient is? Can i look for it somewhere? Can i redirect the process to look for it in the correct place? Any help/hair gratefully received. R
Firstly: JD - Thanks for your thoughts - I had already looked there, but hadn''t thought to try the beta! However, exclamation mark aside... it still doesn''t work. :-( Secondly: I''ve googled ''til I''m blue in the face, and nowhere can I find an explanation as to what is going wrong. Nobody seems to have a definitive answer, and although I''m sure this one''s down to Apple somehow, having read other bug fixes etc for getting Ruby running on previous versions of OS X, it does all seem to have the ''waving a dead chicken'' nature. What worries me, is that this all seems to hang together with spit and bubble gum.... I''ll have another go tomorrow. After which, given the timeframe, I guess I''ll just have to start this project in PHP :-( R
> Can anyone actually tell me what -lmysqlclient is? Can i look for it > somewhere? Can i redirect the process to look for it in the correct > place? > > Any help/hair gratefully received.Try this, excerpted from http://wiki.rubyonrails.com/rails/show/HowtoInstallOnOSXTiger sudo gcc_select 3.3 (this is all one long command) sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql --with-mysql-include=/usr/local/mysql/include/ --with-mysql-lib=/usr/local/mysql/lib/ --with-mysql-config=/usr/local/mysql/bin/mysql_config HTH, -TJ
Richard, check out http://tinyurl.com/cy579. I had no trouble whatsoever using these instructions. HTH, Michael Irwin
TJ - I had already tried this :-( but thanks for the thought. Michael - 47.times {print "Thank you! "} Turns out that with the beta version on http://www.tmtm.org/en/mysql/ ruby/ switching to gcc 3.3 is a red herring. So, with apologies to pjhyett, if anyone''s going back through the digests looking to solve this problem: for Ruby on Rails in OS X 10.4.2: (1) Fresh install of Tiger (2) Install XCode 2 (3) run this script: curl -O rufy.com/fix-ruby-tiger.sh; sh fix-ruby-tiger.sh sudo gem install rails (4) Download and install MySQL 4.1.13 binary from mysql.com (5) Download the latest (2.7beta3?) source from http://tmtm.org/ downloads/mysql/ruby/ (6) Unzip, untar the folder, navigate to it, then type the following: ruby extconf.rb --with-mysql-config sudo make install So, now, if anyone knows a good trichologist... Thanks again, R
Maybe this is coming from left field, but the way I did my install on Tiger was to simply ignore the existence of the pre-installed Ruby and MySQL binaries. Using one of the links off the Wiki, I downloaded an OS X installer for Ruby 1.8, then I downloaded the latest Gem install, ran the setup.rb, then used gem to install the lastest Rails. Finally, I downloaded the Complete MySQL installer from www.serverlogistics.com (they have some really nice OS C install packages), updated my path environment variable and things just worked. No muss, no fuss. -Brian Richard Dyce wrote:> TJ - I had already tried this :-( but thanks for the thought. > > Michael - 47.times {print "Thank you! "} > > Turns out that with the beta version on http://www.tmtm.org/en/mysql/ ruby/ > switching to gcc 3.3 is a red herring. > > So, with apologies to pjhyett, if anyone''s going back through the > digests looking to solve this problem: > > for Ruby on Rails in OS X 10.4.2: > (1) Fresh install of Tiger > (2) Install XCode 2 > (3) run this script: > curl -O rufy.com/fix-ruby-tiger.sh; sh fix-ruby-tiger.sh > sudo gem install rails > (4) Download and install MySQL 4.1.13 binary from mysql.com > (5) Download the latest (2.7beta3?) source from http://tmtm.org/ > downloads/mysql/ruby/ > (6) Unzip, untar the folder, navigate to it, then type the following: > > ruby extconf.rb --with-mysql-config > sudo make install > > So, now, if anyone knows a good trichologist... > > Thanks again, > > R
> sudo gcc_select 3.3 > > (this is all one long command) > sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql > --with-mysql-include=/usr/local/mysql/include/ > --with-mysql-lib=/usr/local/mysql/lib/ > --with-mysql-config=/usr/local/mysql/bin/mysql_configRichard, This is EXACTLY what worked for me... I, too, was frustrated the other night, but after selecting the older GCC compiler, it went off without a hitch! Hopefully this will do it for you. -- - Frank FrankManno.com <a href="http://www.spreadfirefox.com/?q=affiliates&id=2496&t=1">Get Firefox!</a>
The way around this on Tiger is to do the following: $ sudo gcc_select 3.3 $ sudo gem install mysql -- --with-mysql-config $ sudo gcc_select 4.0 I had trouble with the mysql gem using Toger''s stock gcc4.0 so the gcc_select command will change the default gcc version you will use to compile mysql extension. Just don''t forget to change it back to 4.0. And also make sure you have the BSD subsystem and the developers tools installed. HTH- -Ezra Zygmuntowicz Yakima Herald-Republic WebMaster 509-577-7732 ezra-gdxLOakOTQ9oetBuM9ipNAC/G2K4zDHf@public.gmane.org On Aug 18, 2005, at 9:50 AM, Richard Dyce wrote:> Hi ho. > > Am having sooooo much fun trying to get MySQL to talk to Rails. > > Yes, I''m getting "Permission denied - /usr/lib/ruby/gems/1.8/cache/ > mysql-2.6.gem" > > I''ve tried practically everything I can think of. > > Yes, I''ve stopped MySQL server > Yes, I''ve run the update script from tech.rufy... > I''ve even flattened the bloody G5, re-installed from the DVD... (Oh > joy) > ... updated to 10.4.2 ... > ... installed MySQL 4.1.13... > > If I try running ''sudo gem install mysql'' i can get past the > ''Permission denied -'' message, but then I get... > > Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/ > mysql-2.6 for inspection. > ruby extconf.rb install mysql\nchecking for mysql_query() in - > lmysqlclient... no > checking for main() in -lm... yes > checking for mysql_query() in -lmysqlclient... no > checking for main() in -lz... yes > checking for mysql_query() in -lmysqlclient... no > checking for main() in -lsocket... no > checking for mysql_query() in -lmysqlclient... no > checking for main() in -lnsl... no > checking for mysql_query() in -lmysqlclient... no > > What is going on. > > I have no hair left to tear out. > > R > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
As somebody observed on the wiki, the current binary installation of mysql (I think 4.1.13 started this change) is missing the library file that clients build against. The easiest thing to do is to install using darwinports.org. There''s a handy tutorial for doing that here: http://www.sateh.com/projects/sateh/wiki/InstallingRailsOnOSX The darwinports install builds MySQL from source and includes the appropriate library. This resolved all of my problems with the mysql gem build not finding main() etc. Note that if you download the Darwin Ports binary installation instead of the source installation described in the tutorial, your ruby path will change from /usr/local/bin/ruby to /opt/local/bin/ruby and you''ll have to update your shebang lines accordingly. You may also want to remove Ruby, Rake, etc. from /usr/local just to be sure that you''re using the right, well-built version. Cheers, Nick Ezra Zygmuntowicz wrote:> The way around this on Tiger is to do the following: > > $ sudo gcc_select 3.3 > $ sudo gem install mysql -- --with-mysql-config > $ sudo gcc_select 4.0 > > I had trouble with the mysql gem using Toger''s stock gcc4.0 so the > gcc_select command will change the default gcc version you will use to > compile mysql extension. Just don''t forget to change it back to 4.0. > And also make sure you have the BSD subsystem and the developers tools > installed. > > HTH- > -Ezra Zygmuntowicz > Yakima Herald-Republic > WebMaster > 509-577-7732 > ezra-gdxLOakOTQ9oetBuM9ipNAC/G2K4zDHf@public.gmane.org > > > On Aug 18, 2005, at 9:50 AM, Richard Dyce wrote: > >> Hi ho. >> >> Am having sooooo much fun trying to get MySQL to talk to Rails. >> >> Yes, I''m getting "Permission denied - /usr/lib/ruby/gems/1.8/cache/ >> mysql-2.6.gem" >> >> I''ve tried practically everything I can think of. >> >> Yes, I''ve stopped MySQL server >> Yes, I''ve run the update script from tech.rufy... >> I''ve even flattened the bloody G5, re-installed from the DVD... (Oh joy) >> ... updated to 10.4.2 ... >> ... installed MySQL 4.1.13... >> >> If I try running ''sudo gem install mysql'' i can get past the >> ''Permission denied -'' message, but then I get... >> >> Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/ >> mysql-2.6 for inspection. >> ruby extconf.rb install mysql\nchecking for mysql_query() in - >> lmysqlclient... no >> checking for main() in -lm... yes >> checking for mysql_query() in -lmysqlclient... no >> checking for main() in -lz... yes >> checking for mysql_query() in -lmysqlclient... no >> checking for main() in -lsocket... no >> checking for mysql_query() in -lmysqlclient... no >> checking for main() in -lnsl... no >> checking for mysql_query() in -lmysqlclient... no >> >> What is going on. >> >> I have no hair left to tear out. >> >> R >> >> >> _______________________________________________ >> Rails mailing list >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails