Windows Rails new Demo time error makes sure that ' gem install mysql2-v ' 0.3.15 ' succeeds before bundling.

Source: Internet
Author: User

Tag:blog   http   io   for    Issues     cti   new   sql   

  rails new demo--database=mysql last error 
Gem files would remain installed in d:/billfiles/rails_dev/ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.3.15 for Inspection.
Results logged to D:/BILLFILES/RAILS_DEV/RUBY193/LIB/RUBY/GEMS/1.9.1/EXTENSIONS/X86-MINGW32/1.9.1/ Mysql2-0.3.15/gem_make.out
An error occurred while installing MYSQL2 (0.3.15), and bundler cannot continue.


Make sure that ' gem install mysql2-v ' 0.3.15 ' succeeds before bundling.


But after executing this sentence, it is an error, which indicates that it is driving the problem
and then see this article http://blog.mmediasys.com/2011/07/07/ installing-mysql-on-windows-7-x64-and-using-ruby-with-it/
finally found that his ruby193 is 32 bits, MySQL is 64 bits, so Ruby is not connected, So download the 32-bit MySQL driver http://dev.mysql.com/downloads/connector/c/
Select 32-bit zip, unzip and place in the C packing directory, rename to
Mysql-connector-c-noinstall-6.0.2-win32
gem install mysql2 -- --with-mysql-lib="c:\mysql-connector-c-noinstall-6.0.2-win32\lib"  --with-mysql-include="c:\mysql-connector-c-noinstall-6.0.2-win32\include" --with-mysql-dir="c:\mysql-connector-c-noinstall-6.0.2-win32"

最后把其中lib目录中的
mysql-connector-c-noinstall-6.0.2-win32\lib中的libmysql.dll拷贝到ruby下面的bin目录


终于OK!
 
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.