2013-07-20 9 views
6

पर mysql2 स्थापित नहीं कर सकता मैं कोशिश की हैमैक ओएस 10.9

bundle install 

और

gem install mysql2 

और

rvm gem install mysql2 

सभी नीचे एक ही उत्पादन किया है।

rMBP:scripts admin$ rvm gem install mysql2 
Please note that `rvm gem ...` was removed, try `gem install mysql2` or `rvm all do gem install mysql2` instead. (see: 'rvm usage') 
rMBP:scripts admin$ rvm all do gem install mysql2 
Building native extensions. This could take a while... 
ERROR: Error installing mysql2: 
    ERROR: Failed to build gem native extension. 

    /Users/admin/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb 
checking for rb_thread_blocking_region()... yes 
checking for rb_wait_for_single_fd()... yes 
checking for rb_hash_dup()... yes 
checking for rb_intern3()... yes 
checking 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 
checking for main() in -lmygcc... no 
checking for mysql_query() in -lmysqlclient... no 
*** extconf.rb failed *** 
Could not create Makefile due to some reason, probably lack of necessary 
libraries and/or headers. Check the mkmf.log file for more details. You may 
need configuration options. 

Provided configuration options: 
    --with-opt-dir 
    --with-opt-include 
    --without-opt-include=${opt-dir}/include 
    --with-opt-lib 
    --without-opt-lib=${opt-dir}/lib 
    --with-make-prog 
    --without-make-prog 
    --srcdir=. 
    --curdir 
    --ruby=/Users/admin/.rvm/rubies/ruby-2.0.0-p247/bin/ruby 
    --with-mysql-config 
    --without-mysql-config 
    --with-mysql-dir 
    --without-mysql-dir 
    --with-mysql-include 
    --without-mysql-include=${mysql-dir}/include 
    --with-mysql-lib 
    --without-mysql-lib=${mysql-dir}/ 
    --with-mysqlclientlib 
    --without-mysqlclientlib 
    --with-mlib 
    --without-mlib 
    --with-mysqlclientlib 
    --without-mysqlclientlib 
    --with-zlib 
    --without-zlib 
    --with-mysqlclientlib 
    --without-mysqlclientlib 
    --with-socketlib 
    --without-socketlib 
    --with-mysqlclientlib 
    --without-mysqlclientlib 
    --with-nsllib 
    --without-nsllib 
    --with-mysqlclientlib 
    --without-mysqlclientlib 
    --with-mygcclib 
    --without-mygcclib 
    --with-mysqlclientlib 
    --without-mysqlclientlib 


Gem files will remain installed in /Users/admin/.rvm/gems/ruby-2.0.0-p247/gems/mysql2-0.3.13 for inspection. 
Results logged to /Users/admin/.rvm/gems/ruby-2.0.0-p247/gems/mysql2-0.3.13/ext/mysql2/gem_make.out 
rMBP:scripts admin$ 

मैं Xcode 5 DP3 और मेवरिक 10.9 नवीनतम बीटा (13A510d) है

Xcode 5 एप्लिकेशन करने के लिए बनाया (एप्लिकेशन पैकेज के अंदर) कमांड लाइन उपकरण

+0

क्या आपके पास MySQL और इसकी पुस्तकालय स्थापित हैं? मणि सिर्फ सी पुस्तकालयों में रूबी इंटरफ़ेस प्रदान करता है। –

+0

मेरे पास यह नहीं है –

+0

सभी MySQL सामग्री ([ब्रू] (http://mxcl.github.io/homebrew/) को यहां सहायक होना चाहिए) और फिर आप मणि इंस्टॉल कर सकते हैं। –

उत्तर

24

सबसे पहले, आप MySql स्थापित करने की आवश्यकता है, और मैं homebrew

brew install mysql 

उपयोग करें यदि आप 10.9 डी पी -3 का उपयोग करें, आप मुझे SystemVersion.plist में 10.8 में स्थित करने के लिए ProductVersion बदलकर धोखा fail.But सकता है/सिस्टम/लाइब्रेरी/कोर सर्विसेज, और फिर आप mysql इंस्टॉल कर सकते हैं।

mysql2

gem install mysql2 

स्थापित करने के लिए आप सभी सामान को स्थापित करने के बाद, आप 10.9 करने के लिए वापस ProductVersion में परिवर्तन करना होगा जारी रखें।

5

में बताने के लिए की जरूरत है मणि जब mysql पाया जा सकता है, सबसे अच्छा तरीका mysql_config उपयोग कर रहा है:

gem install mysql -- --with-mysql-config=/path/to/mysql/bin/mysql_config 

पथ जहां mysql स्थापित किया पर निर्भर करेगा।

+0

एक ही बात हुई। मणि mysql - --with-mysql-config =/path/to/mysql/bin/mysql_config प्राप्त करना: mysql-2.9.1.gem (100%) मूल एक्सटेंशन का निर्माण: '--with-mysql- config =/path/to/mysql/bin/mysql_config ' इसमें कुछ समय लग सकता है ... त्रुटि: mysql: \t त्रुटि स्थापित करने में त्रुटि: मणि देशी एक्सटेंशन बनाने में विफल। –

+0

मैंने इस ऑपरेशन के लिए mysql –

+0

स्थापित नहीं किया है, आपको कम से कम libmysql-client की आवश्यकता है, सर्वर भाग की आवश्यकता नहीं है - लेकिन यदि आप MySQL डेटाबेस पर एप्लिकेशन चलाने के लिए चाहते हैं - तो मैं mysql सर्वर को स्थापित और कॉन्फ़िगर करने की अनुशंसा करता हूं, फिर MySQL स्थापना के लिए उचित पथ का उपयोग करें। – mpapis