简体   繁体   中英

How do I install mysql gem using bundler? (OS X Lion)

So, I currently have to do this to install the mysql gem:

export ARCHFLAGS="-arch x86_64" ; sudo gem install --no-rdoc --no-ri mysql -v 2.7 -- --with-mysql-dir=/usr/local --with-mysql-config=/usr/local/mysql/bin/mysql_config

now, in bundler, I'd do something like

gem "mysql", "2.7"

which gives the error:

uninitialized constant MysqlCompat::MysqlRes

because the mysql gem isn't built right.

EDIT: oh, I'm also using RVM.
What I i'm going to try, is re-install the mysql gem normally (the long command), and try copying it into the rvm directory.

I'm on OS X Lion

use

gem install mysql2 -v 0.2.6

instead of

gem "mysql", "2.7"

I had the same issue.

I fixed the problem (kinda) by not using a gemset.
So, all my gems for this project are in the main ruby 1.8.7 environment inside ~/.rvm/.

=\\

So.. that's one way to do it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM