Greg Hauptmann
2008-Apr-12 02:24 UTC
mysql gem install error on Mac OS X - ''ulong'' undeclared error
Hi, I can''t seem to install the mysql gem for Ruby (see errors below). I get an ''ulong'' undeclared error. Can anyone assist? ============ERROR======================== Macintosh:mysql-2.7 greg$ sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config Password: Building native extensions. This could take a while... ERROR: Error installing mysql: ERROR: Failed to build gem native extension. /opt/local/bin/ruby extconf.rb install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config checking for mysql_ssl_set()... yes checking for mysql.h... yes creating Makefile make gcc -I. -I. -I/opt/local/lib/ruby/1.8/i686-darwin8.10.1 -I. -DHAVE_MYSQL_SSL_SET -DHAVE_MYSQL_H -I/opt/local/include -I/usr/local/mysql/include -Os -arch i386 -fno-common -fno-common -O2 -fno-common -pipe -fno-common -c mysql.c mysql.c: In function ''Init_mysql'': mysql.c:2015: error: ''ulong'' undeclared (first use in this function) mysql.c:2015: error: (Each undeclared identifier is reported only once mysql.c:2015: error: for each function it appears in.) mysql.c:2015: error: syntax error before numeric constant mysql.c:2018: error: syntax error before numeric constant make: *** [mysql.o] Error 1 Gem files will remain installed in /opt/local/lib/ruby/gems/1.8/gems/mysql-2.7 for inspection. Results logged to /opt/local/lib/ruby/gems/1.8/gems/mysql-2.7/gem_make.out ===========VERSION INFO========================= Macintosh:mysql-2.7 greg$ ruby --version ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-darwin8.10.1] Macintosh:mysql-2.7 greg$ rails --version Rails 2.0.2 Macintosh:mysql-2.7 greg$ gem --version 1.1.0 =========MacBook Details=========================== Model Name: MacBook Model Identifier: MacBook2,1 Processor Name: Intel Core 2 Duo Processor Speed: 2 GHz System Version: Mac OS X 10.5.2 (9C7010) Kernel Version: Darwin 9.2.2 Regards Greg --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Philip Hallstrom
2008-Apr-12 03:31 UTC
Re: mysql gem install error on Mac OS X - ''ulong'' undeclared error
> I can''t seem to install the mysql gem for Ruby (see errors below). I get an > ''ulong'' undeclared error. Can anyone assist?Hopefully this will help... http://jlaine.net/2006/10/3/installing-ruby-mysql-driver-on-os-x (read through the comments as well)> > > ============ERROR========================> > Macintosh:mysql-2.7 greg$ sudo gem install mysql -- > --with-mysql-config=/usr/local/mysql/bin/mysql_config > > Password: > > Building native extensions. This could take a while... > > ERROR: Error installing mysql: > > ERROR: Failed to build gem native extension. > > > /opt/local/bin/ruby extconf.rb install mysql -- > --with-mysql-config=/usr/local/mysql/bin/mysql_config > > checking for mysql_ssl_set()... yes > > checking for mysql.h... yes > > creating Makefile > > > make > > gcc -I. -I. -I/opt/local/lib/ruby/1.8/i686-darwin8.10.1 -I. > -DHAVE_MYSQL_SSL_SET -DHAVE_MYSQL_H -I/opt/local/include > -I/usr/local/mysql/include -Os -arch i386 -fno-common -fno-common -O2 > -fno-common -pipe -fno-common -c mysql.c > > mysql.c: In function ''Init_mysql'': > > mysql.c:2015: error: ''ulong'' undeclared (first use in this function) > > mysql.c:2015: error: (Each undeclared identifier is reported only once > > mysql.c:2015: error: for each function it appears in.) > > mysql.c:2015: error: syntax error before numeric constant > > mysql.c:2018: error: syntax error before numeric constant > > make: *** [mysql.o] Error 1 > > > > Gem files will remain installed in > /opt/local/lib/ruby/gems/1.8/gems/mysql-2.7 for inspection. > > Results logged to /opt/local/lib/ruby/gems/1.8/gems/mysql-2.7/gem_make.out > > > ===========VERSION INFO=========================> > Macintosh:mysql-2.7 greg$ ruby --version > > ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-darwin8.10.1] > > Macintosh:mysql-2.7 greg$ rails --version > > Rails 2.0.2 > > Macintosh:mysql-2.7 greg$ gem --version > > 1.1.0 > > > =========MacBook Details===========================> > Model Name: MacBook > > Model Identifier: MacBook2,1 > > Processor Name: Intel Core 2 Duo > > Processor Speed: 2 GHz > > > System Version: Mac OS X 10.5.2 (9C7010) > > Kernel Version: Darwin 9.2.2 > > > > > Regards > > Greg > > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Amol Neurgaonkar
2010-Sep-22 22:18 UTC
Re: mysql gem install error on Mac OS X - ''ulong'' undeclared error
Philip Hallstrom wrote:>> I can''t seem to install the mysql gem for Ruby (see errors below). I get an >> ''ulong'' undeclared error. Can anyone assist? > > Hopefully this will help... > > http://jlaine.net/2006/10/3/installing-ruby-mysql-driver-on-os-x > > (read through the comments as well)I have tried the solutions above and no success. Finally I decided to add #define ulong unsigned long to /usr/include/stdlib.h and tried installing again and voila, it worked ! Have also suggested this solution to many people and so far have not found any issues with it. -- Posted via http://www.ruby-forum.com/. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.