简体   繁体   中英

Install gem mysql2 with lampp

I'm trying to get gem running with apache server installed in /opt (LAMPP bundle). There was an error when I tried to install mysql2 gem. After searching I did following:

aptitude install libmysql-ruby libmysqlclient-dev ruby-dev

And then:

gem install mysql2 -- --with-mysql-config=/opt/lampp/bin/mysql_config --with-mysql-dir=/opt/lampp/lib/mysql --with-mysql-lib=/opt/lampp/lib/mysql/ --with-mysql-include=/usr/include/mysql

Here's the response:

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.h... no
checking for mysql/mysql.h... yes
checking for errmsg.h... no
-----
errmsg.h is missing.  please check your installation of mysql and try again.
-----
*** 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
--without-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=/usr/bin/ruby1.9.1
--with-mysql-config


Gem files will remain installed in /var/lib/gems/1.9.1/gems/mysql2-0.3.13 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/mysql2-0.3.13/ext/mysql2/gem_make.out

So, the trouble is errmsg.h library. After installing dev packages ruby found few other missing libraries, eg 'mysql.h', but not this one. I have no idea what to do now... I saw many anwers for similar questions here, but none of them was helpful.

Any help will be appreciated.

I finally gave up. Lampp is good for start, but now I need many things that are not bundled and installing them is more and more complicated. I moved everything to virtual machine and it works flawless.

well I know it's quite a long time ago... but I had the same trouble nowadays. you just had do use the include folder of lampp nativly to find all needed dependencies.

so the wording would look like

 gem install mysql2 -- --with-mysql-config=/opt/lampp/bin/mysql_config --with-mysql-dir=/opt/lampp/mysql --with-mysql-lib=/opt/lampp/lib/mysql/ --with-mysql-include=/opt/lampp/include/

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