Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/59.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 为什么我在尝试安装Ruby GEM bundler时会出现与缺少MySql相关的错误消息?我正在使用MariaDB_Ruby On Rails_Ruby_Bash_Ubuntu_Rubygems - Fatal编程技术网

Ruby on rails 为什么我在尝试安装Ruby GEM bundler时会出现与缺少MySql相关的错误消息?我正在使用MariaDB

Ruby on rails 为什么我在尝试安装Ruby GEM bundler时会出现与缺少MySql相关的错误消息?我正在使用MariaDB,ruby-on-rails,ruby,bash,ubuntu,rubygems,Ruby On Rails,Ruby,Bash,Ubuntu,Rubygems,我对Ruby不太感兴趣,在我的Ubuntu 16.04服务器上安装MariaDB而不是MySql时,我遇到了以下问题 我遵循这一官方指南: 因此,考虑到前面的教程,我遵循了除此之外的所有安装点: sudo apt-get install mysql-server mysql-client 因为我不想安装MySql服务器,因为我刚刚安装了,而且我正在这台服务器上使用MarriaDB 当我执行此操作以安装gem捆绑程序时,我的安装问题出现: sudo gem update 事实上,我获得的这些

我对Ruby不太感兴趣,在我的Ubuntu 16.04服务器上安装MariaDB而不是MySql时,我遇到了以下问题

我遵循这一官方指南:

因此,考虑到前面的教程,我遵循了除此之外的所有安装点:

sudo apt-get install mysql-server mysql-client 
因为我不想安装MySql服务器,因为我刚刚安装了,而且我正在这台服务器上使用MarriaDB

当我执行此操作以安装gem捆绑程序时,我的安装问题出现:

sudo gem update
事实上,我获得的这些错误消息似乎与缺少的MySql安装有关(或者我认为是这样……如果我做了错误的断言,请纠正我):

所以,我的第一个疑问是,如果整个安装失败,或者只是部分安装失败

正如您所看到的,它在一些与MySql相关的问题上失败了(我认为安装MySql服务器和bash-MySql客户端

问题是我不必使用MySql,但我必须使用MariaDB,我无法更改它

阅读前面的错误输出时,它表示进一步的信息进入了这个文件:/var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/mysql2-0.4.5/,这是它的内容:

current directory: /var/lib/gems/2.3.0/gems/mysql2-0.4.5/ext/mysql2
/usr/bin/ruby2.3 -r ./siteconf20161115-17488-ql00no.rb extconf.rb
checking for rb_absint_size()... yes
checking for rb_absint_singlebit_p()... yes
checking for ruby/thread.h... yes
checking for rb_thread_call_without_gvl() in ruby/thread.h... yes
checking for rb_thread_blocking_region()... no
checking for rb_wait_for_single_fd()... yes
checking for rb_hash_dup()... yes
checking for rb_intern3()... yes
checking for rb_big_cmp()... yes
checking for mysql_query() in -lmysqlclient... no
-----
mysql client is missing. You may need to 'apt-get install libmysqlclient-dev' or 'yum install mysql-devel', 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/$(RUBY_BASE_NAME)2.3
        --with-mysql-dir
据我在网上阅读的理解,这个gem_make.out文件应该包含编译过程中的错误(或类似的内容)。在我看来,它只是说它缺少了mysql客户端


如何避免安装MySql并使用我的MariaDB安装?

MariaDB是MySql的一种二进制插入式重新定位,如您所见。它甚至运行在同一个端口上,普通用户(不使用高级功能)甚至不会注意到MySQL是否被MariaDB取代。存在一些不兼容,但需要付出一些努力才能在常用中解决其中一个问题

在大多数Linux发行版中,包括那些选择MariaDB作为标准的发行版,比如Slackware,构建头仍然是“MySQL方式”

然后,您所需要做的就是让您的MariaDB服务器安装并运行。然后安装
libmysqlclient-dev
do-you
bundle-install
。一切都会好的。我已经做过很多次了


我不知道你的Rails版本是什么,但是如果你遇到一些不兼容的问题,可以考虑升级到Rails 5。正如RailsFive所说,它似乎为MariaDB提供了支持。但不幸的是,我从未使用过这种支持,也无法告诉您任何有关它的信息。

可能的重复发生在MariaDB是二进制drop取代MySQL的情况下。在大多数Linux发行版中,它依赖于相同的包来运行/构建。它在同一个端口上运行。特别是,它取决于
libmysqlclient-dev
。然后,如果安装
libmysqlclient-dev
并使用MariaDB服务器,一切都会很好。我一直在这样做。看看这个:最后:@EddeAlmeida Ok tnx,如果你把它作为回应发布,我会接受的
current directory: /var/lib/gems/2.3.0/gems/mysql2-0.4.5/ext/mysql2
/usr/bin/ruby2.3 -r ./siteconf20161115-17488-ql00no.rb extconf.rb
checking for rb_absint_size()... yes
checking for rb_absint_singlebit_p()... yes
checking for ruby/thread.h... yes
checking for rb_thread_call_without_gvl() in ruby/thread.h... yes
checking for rb_thread_blocking_region()... no
checking for rb_wait_for_single_fd()... yes
checking for rb_hash_dup()... yes
checking for rb_intern3()... yes
checking for rb_big_cmp()... yes
checking for mysql_query() in -lmysqlclient... no
-----
mysql client is missing. You may need to 'apt-get install libmysqlclient-dev' or 'yum install mysql-devel', 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/$(RUBY_BASE_NAME)2.3
        --with-mysql-dir