2012-05-23 14 views
6

मैं एक नया रेल परियोजनागलत MySQL क्लाइंट लाइब्रेरी संस्करण

rails new simple_cms 

बुला फिर जब निर्देशिका में मैं चलाने

rails s 

मैं पालन त्रुटियों मिल बनाया

C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/l 
ib/mysql2/mysql2.rb:2:in `require': Incorrect MySQL client library version! This 
gem was compiled for 6.0.0 but the client library is 5.5.24. (RuntimeError) 
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11- 
x86-mingw32/lib/mysql2/mysql2.rb:2:in `<top (required)>' 
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11- 
x86-mingw32/lib/mysql2.rb:9:in `require' 
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11- 
x86-mingw32/lib/mysql2.rb:9:in `<top (required)>' 
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/ 
lib/bundler/runtime.rb:68:in `require' 
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/ 
lib/bundler/runtime.rb:68:in `block (2 levels) in require' 
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/ 
lib/bundler/runtime.rb:66:in `each' 
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/ 
lib/bundler/runtime.rb:66:in `block in require' 
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/ 
lib/bundler/runtime.rb:55:in `each' 
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/ 
lib/bundler/runtime.rb:55:in `require' 
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/ 
lib/bundler.rb:119:in `require' 
    from c:/development/ruby/simple_cms/config/application.rb:7:in `<top (re 
quired)>' 
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.3 
/lib/rails/commands.rb:53:in `require' 
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.3 
/lib/rails/commands.rb:53:in `block in <top (required)>' 
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.3 
/lib/rails/commands.rb:50:in `tap' 
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.3 
/lib/rails/commands.rb:50:in `<top (required)>' 
    from script/rails:6:in `require' 
    from script/rails:6:in `<main>' 

मेरे पास है इस त्रुटि के साथ अन्य लोगों को देखा लेकिन वे लिनक्स उपयोगकर्ता हैं और मैं खिड़कियां चला रहा हूं। मैंने दोनों रेल (railsinstaller.org) और mysql 5.5 को पुनर्स्थापित करने का प्रयास किया है। मैंने 32 बिट संस्करण के साथ-साथ 64 बिट संस्करण

+0

+1 प्रासंगिक प्रश्न पूछने के लिए – neeraj

उत्तर

13

दोनों के बारे में पहले से ही इस पर कई प्रश्न हैं। क्या आपने उनके समाधान की कोशिश की? mysql2 gem compiled for wrong mysql client library

उचित हिस्सा यहाँ है:

At the time of building this gem, the necessary DLL files where available 
in the following download: 

http://dev.mysql.com/get/Downloads/Connector-C/mysql-connector-c-noinstall-6.0.2-win32.zip/from/pick 

And put lib\libmysql.dll file in your Ruby bin directory, for example 
C:\Ruby\bin 
+0

मैंने उसे देखा। मैं libmysql.dll को स्थानांतरित करने के बारे में आखिरी कदम याद किया। अब यह काम कर रहा है। धन्यवाद! मेरे अतिरिक्त प्रयासों को बचाने के लिए – mhopkins321

+1

+1 – neeraj

0

मैं एक नई परियोजना मैं जिस पर काम कर रहा था में इस त्रुटि था अचानक एक विंडोज़ मशीन में काम करना बंद कर

शायद सबसे स्पष्ट यह है कि पहले से ही रेल परियोजनाओं काम कर रहा था, तो यह स्पष्ट रूप से एक स्थापना समस्या नहीं थी।

समस्या bundle update कमांड का कारण क्या था, जिसने mysql2 मणि ​​(अज्ञात कारणों से) को फिर से लोड करने का निर्णय लिया और मेरी जेमफाइल लाइन मणि 'mysql2', '~> 0.2.6' को अनदेखा कर दिया।

समस्या यह है कि बंडल अद्यतन, mysql संस्करण 0.2.18 मिल गया के रूप में Gemfile.lock में दिखाया गया है निम्न पंक्ति में, था:

mysql2 (0.2.18-x86-mingw32) 

यकीन है कि क्या इसका मतलब प्रतीक ध्यान दें मैं हूँ, लेकिन मैं बदल दिया

gem 'mysql2', '0.2.6' 

के लिए मेरे gemfile

gem 'mysql2', '~> 0.2.6' 

में लाइन निम्नलिखित और अब सब कुछ ठीक काम करता है, bundle update सहित।

4

यह मणि और इसकी निर्भरताओं को हटा देगा। फिर पुनर्स्थापित करने से स्वयं और सभी निर्भरताओं को फिर से संकलित किया जाएगा।

gem uninstall mysql2 
bundle install 
संबंधित मुद्दे