简体   繁体   English

使用Lampp安装gem mysql2

[英]Install gem mysql2 with lampp

I'm trying to get gem running with apache server installed in /opt (LAMPP bundle). 我正在尝试让/ opt(LAMPP捆绑包)中安装的apache服务器运行gem。 There was an error when I tried to install mysql2 gem. 当我尝试安装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. 因此,麻烦的是errmsg.h库。 After installing dev packages ruby found few other missing libraries, eg 'mysql.h', but not this one. 安装开发包后,ruby发现了其他一些缺少的库,例如'mysql.h',但没有这个库。 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. Lampp对于开始非常有用,但是现在我需要许多未捆绑的东西,并且安装它们变得越来越复杂。 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. 您只是真的使用了lampp的include文件夹来查找所有需要的依赖项。

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/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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