Skip to content

Instantly share code, notes, and snippets.

@windhamdavid
Created May 14, 2011 20:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save windhamdavid/972626 to your computer and use it in GitHub Desktop.
Save windhamdavid/972626 to your computer and use it in GitHub Desktop.
david$ env ARCHFLAGS="-arch x86_64" gem install mysql2
ERROR: While executing gem ... (Errno::EACCES)
Permission denied - /Users/david/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.3.2/.gitignore
SilverBullet:ror david$ sudo env ARCHFLAGS="-arch x86_64" gem install mysql2
Password:
Building native extensions. This could take a while...
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.
/Users/david/.rvm/rubies/ruby-1.9.2-p180/bin/ruby extconf.rb
checking for rb_thread_blocking_region()... yes
checking for mysql.h... yes
checking for errmsg.h... yes
checking for mysqld_error.h... yes
creating Makefile
make
gcc -I. -I/Users/david/.rvm/rubies/ruby-1.9.2-p180/include/ruby-1.9.1/i386-darwin9.8.0 -I/Users/david/.rvm/rubies/ruby-1.9.2-p180/include/ruby-1.9.1/ruby/backward -I/Users/david/.rvm/rubies/ruby-1.9.2-p180/include/ruby-1.9.1 -I. -DHAVE_RB_THREAD_BLOCKING_REGION -DHAVE_MYSQL_H -DHAVE_ERRMSG_H -DHAVE_MYSQLD_ERROR_H -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/usr/local/mysql/include -Os -g -fno-common -fno-strict-aliasing -arch x86_64 -fno-common -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wshorten-64-to-32 -Wno-long-long -fno-common -pipe -Wall -funroll-loops -o client.o -c client.c
In file included from /Users/david/.rvm/rubies/ruby-1.9.2-p180/include/ruby-1.9.1/ruby.h:32,
from ./mysql2_ext.h:8,
from client.c:1:
/Users/david/.rvm/rubies/ruby-1.9.2-p180/include/ruby-1.9.1/ruby/ruby.h:108: error: size of array ‘ruby_check_sizeof_long’ is negative
/Users/david/.rvm/rubies/ruby-1.9.2-p180/include/ruby-1.9.1/ruby/ruby.h:112: error: size of array ‘ruby_check_sizeof_voidp’ is negative
In file included from /Users/david/.rvm/rubies/ruby-1.9.2-p180/include/ruby-1.9.1/ruby/intern.h:29,
from /Users/david/.rvm/rubies/ruby-1.9.2-p180/include/ruby-1.9.1/ruby/ruby.h:1327,
from /Users/david/.rvm/rubies/ruby-1.9.2-p180/include/ruby-1.9.1/ruby.h:32,
from ./mysql2_ext.h:8,
from client.c:1:
/Users/david/.rvm/rubies/ruby-1.9.2-p180/include/ruby-1.9.1/ruby/st.h:69: error: size of array ‘st_check_for_sizeof_st_index_t’ is negative
client.c: In function ‘rb_raise_mysql2_error’:
client.c:92: warning: comparison is always true due to limited range of data type
client.c: In function ‘rb_mysql_client_escape’:
client.c:174: warning: unused parameter ‘klass’
client.c: In function ‘rb_mysql_client_socket’:
client.c:531: warning: comparison is always true due to limited range of data type
client.c:531: warning: comparison is always true due to limited range of data type
client.c: In function ‘init_mysql2_client’:
client.c:736: warning: comparison is always true due to limited range of data type
client.c:736: warning: comparison is always true due to limited range of data type
client.c:741: warning: comparison is always true due to limited range of data type
client.c:741: warning: comparison is always true due to limited range of data type
client.c:746: warning: comparison is always true due to limited range of data type
client.c:746: warning: comparison is always true due to limited range of data type
client.c:751: warning: comparison is always true due to limited range of data type
client.c:751: warning: comparison is always true due to limited range of data type
client.c:756: warning: comparison is always true due to limited range of data type
client.c:756: warning: comparison is always true due to limited range of data type
client.c:760: warning: comparison is always true due to limited range of data type
client.c:760: warning: comparison is always true due to limited range of data type
client.c:764: warning: comparison is always true due to limited range of data type
client.c:764: warning: comparison is always true due to limited range of data type
client.c:769: warning: comparison is always true due to limited range of data type
client.c:769: warning: comparison is always true due to limited range of data type
client.c:774: warning: comparison is always true due to limited range of data type
client.c:774: warning: comparison is always true due to limited range of data type
client.c:779: warning: comparison is always true due to limited range of data type
client.c:779: warning: comparison is always true due to limited range of data type
client.c:784: warning: comparison is always true due to limited range of data type
client.c:784: warning: comparison is always true due to limited range of data type
client.c:788: warning: comparison is always true due to limited range of data type
client.c:788: warning: comparison is always true due to limited range of data type
client.c:793: warning: comparison is always true due to limited range of data type
client.c:793: warning: comparison is always true due to limited range of data type
client.c:798: warning: comparison is always true due to limited range of data type
client.c:798: warning: comparison is always true due to limited range of data type
client.c:802: warning: comparison is always true due to limited range of data type
client.c:802: warning: comparison is always true due to limited range of data type
client.c:807: warning: comparison is always true due to limited range of data type
client.c:807: warning: comparison is always true due to limited range of data type
client.c:812: warning: implicit conversion shortens 64-bit value into a 32-bit value
client.c:812: warning: comparison is always true due to limited range of data type
client.c:812: warning: comparison is always true due to limited range of data type
client.c:817: warning: implicit conversion shortens 64-bit value into a 32-bit value
client.c:817: warning: comparison is always true due to limited range of data type
client.c:817: warning: comparison is always true due to limited range of data type
client.c:822: warning: implicit conversion shortens 64-bit value into a 32-bit value
client.c:822: warning: comparison is always true due to limited range of data type
client.c:822: warning: comparison is always true due to limited range of data type
client.c:827: warning: implicit conversion shortens 64-bit value into a 32-bit value
client.c:827: warning: comparison is always true due to limited range of data type
client.c:827: warning: comparison is always true due to limited range of data type
client.c:832: warning: implicit conversion shortens 64-bit value into a 32-bit value
client.c:832: warning: comparison is always true due to limited range of data type
client.c:832: warning: comparison is always true due to limited range of data type
client.c:837: warning: implicit conversion shortens 64-bit value into a 32-bit value
client.c:837: warning: comparison is always true due to limited range of data type
client.c:837: warning: comparison is always true due to limited range of data type
make: *** [client.o] Error 1
Gem files will remain installed in /Users/david/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.3.2 for inspection.
Results logged to /Users/david/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.3.2/ext/mysql2/gem_make.out
@windhamdavid
Copy link
Author

solved with sudo gem install mysql2 -- --srcdir=/usr/local/mysql/include

@windhamdavid
Copy link
Author

ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment