Rails, Ruby 1.9.3p0, and mysql gem

*爱你&永不变心* 提交于 2019-12-04 05:26:50
sage

I was just having similar problems and you may be doing what I was: I was using 'gem list' to determine what was installed (it lists *** LOCAL GEMS *** just like you show) and I saw mysql, but the Gemfile for my project was not requiring bundler to install mysql.

If you just type bundle show does it list 'mysql'? If not, then the Gemfile in chiliproject is not causing bundler to install mysql. I found this all very confusing until I realized I was confusing different ways of managing what gems are installed.

If you or others who comes this way are having the same issue, then perhaps this is helpful. (And perhaps this poor explanation will encourage one of the rails gurus to elaborate for us.)

To say it another way, the list of your locally installed gems, isn't the same as the list installed in your app's bundle of gems (hence where the name of the bundler tool comes from). When you're running your app, and managing its dependencies with bundler you have to do everything within the bundler scope, in order to make sure it all works together. When you do that it's actually very straight forward and solves a lot of problems for you, but if you're coming from previous experience on apps that didn't use bundler then it just takes a little getting used to.

Lucho

2 steps that worked for me:

  1. Copy the file libmySQL.dll from /libhttp://dev.mysql.com/get/Downloads/Connector-C/mysql-connector-c-noinstall-6.0.2-win32.zip/from/pick (in the folder /lib/) in c:/your/path/to/ruby/bin (Make sure your ruby bin is in your system PATH environnement variable)

  2. The Default setup is given for MySQL with ruby1.8. If you're running Redmine with MySQL and ruby1.9, replace the adapter name with mysql2 in your /config/database.yml file http://www.redmine.org/issues/10566

Just on bundle install try this >>

bundle install --without=test development sqlite postgres mysql rmagick

This will install all required base dependencies, the mysql2 database adapter Cause mysql adapter is not compatible with Ruby 1.9

And don't forget to change config/database.yml --> s/mysql/mysql2

\o/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!