简体   繁体   English

当我尝试在 Ubuntu 上安装 gem bundler 时,为什么会收到这些错误消息? (无法创建 Makefile)

[英]Why I obtain these error messages when I try to install gem bundler on Ubuntu? (Could not create Makefile)

I am not a Ruby developer and I am finding many difficult to install Redmine (that is developed in Ruby) on an Ububuntu 16.04 server.我不是 Ruby 开发人员,我发现在 Ububuntu 16.04 服务器上安装Redmine (用 Ruby 开发)有很多困难。

I am following this official tutorial: http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_on_Ubuntu_step_by_step我正在关注这个官方教程: http : //www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_on_Ubuntu_step_by_step

It seems very simple but I am finding many difficult when it "ensure that the bundler GEM is installed".这看起来很简单,但是当它“确保安装了 bundler GEM”时,我发现很多困难。

I am not sure about what exactly is this bundler GEM that have to be installed.我不确定必须安装的这个bundler GEM到底是什么。 From what I have understand (correct me if I am doing wrong assertion) a GEM is something that packages excutable Ruby application (something like a JAR file in Java).据我所知(如果我做错了断言,请纠正我)GEM 是打包可执行的 Ruby 应用程序的东西(类似于 Java 中的JAR文件)。

So, the problem is that when I perform this statment in the bash console:所以,问题是当我在 bash 控制台中执行此语句时:

sudo gem update

I obtain many error messages like this:我收到许多这样的错误消息:

root@Betrivius-VPS:~# sudo gem update
Updating installed gems
Updating molinillo
Fetching: molinillo-0.5.4.gem (100%)
Successfully installed molinillo-0.5.4
Parsing documentation for molinillo-0.5.4
Installing ri documentation for molinillo-0.5.4
Installing darkfish documentation for molinillo-0.5.4
Done installing documentation for molinillo after 1 seconds
Parsing documentation for molinillo-0.5.4
Done installing documentation for molinillo after 0 seconds
Updating mysql2
Building native extensions.  This could take a while...
ERROR:  Error installing mysql2:
        ERROR: Failed to build gem native extension.

    current directory: /var/lib/gems/2.3.0/gems/mysql2-0.4.5/ext/mysql2
/usr/bin/ruby2.3 -r ./siteconf20161115-29205-1v41srl.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
        --without-mysql-dir
        --with-mysql-include
        --without-mysql-include=${mysql-dir}/include
        --with-mysql-lib
        --without-mysql-lib=${mysql-dir}/lib
        --with-mysql-config
        --without-mysql-config
        --with-mysql-dir
        --without-mysql-dir
        --with-mysql-include
        --without-mysql-include=${mysql-dir}/include
        --with-mysql-lib
        --without-mysql-lib=${mysql-dir}/lib
        --with-mysqlclientlib
        --without-mysqlclientlib

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/mysql2-0.4.5/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.3.0/gems/mysql2-0.4.5 for inspection.
Results logged to /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/mysql2-0.4.5/gem_make.out
Updating nokogiri
Building native extensions.  This could take a while...
ERROR:  Error installing nokogiri:
        ERROR: Failed to build gem native extension.

    current directory: /var/lib/gems/2.3.0/gems/nokogiri-1.6.8.1/ext/nokogiri
/usr/bin/ruby2.3 -r ./siteconf20161115-29205-11qd2.rb extconf.rb
checking if the C compiler accepts ... yes
Building nokogiri using packaged libraries.
Using mini_portile version 2.1.0
checking for gzdopen() in -lz... no
zlib is missing; necessary for building libxml2
*** 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
        --help
        --clean
        --use-system-libraries
        --enable-static
        --disable-static
        --with-zlib-dir
        --without-zlib-dir
        --with-zlib-include
        --without-zlib-include=${zlib-dir}/include
        --with-zlib-lib
        --without-zlib-lib=${zlib-dir}/lib
        --enable-cross-build
        --disable-cross-build

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/nokogiri-1.6.8.1/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.3.0/gems/nokogiri-1.6.8.1 for inspection.
Results logged to /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/nokogiri-1.6.8.1/gem_make.out
Updating psych
Fetching: psych-2.2.0.gem (100%)
Building native extensions.  This could take a while...
Successfully installed psych-2.2.0
Parsing documentation for psych-2.2.0
Installing ri documentation for psych-2.2.0
Installing darkfish documentation for psych-2.2.0
Done installing documentation for psych after 2 seconds
Parsing documentation for psych-2.2.0
Done installing documentation for psych after 1 seconds
Updating rmagick
Building native extensions.  This could take a while...
ERROR:  Error installing rmagick:
        ERROR: Failed to build gem native extension.

    current directory: /var/lib/gems/2.3.0/gems/rmagick-2.16.0/ext/RMagick
/usr/bin/ruby2.3 -r ./siteconf20161115-29205-1qfeji3.rb extconf.rb
checking for gcc... yes
checking for Magick-config... no
checking for pkg-config... no
Can't install RMagick 2.16.0. Can't find Magick-config or pkg-config in /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin

*** 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

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/rmagick-2.16.0/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.3.0/gems/rmagick-2.16.0 for inspection.
Results logged to /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/rmagick-2.16.0/gem_make.out
Updating sqlite3
Building native extensions.  This could take a while...
ERROR:  Error installing sqlite3:
        ERROR: Failed to build gem native extension.

    current directory: /var/lib/gems/2.3.0/gems/sqlite3-1.3.12/ext/sqlite3
/usr/bin/ruby2.3 -r ./siteconf20161115-29205-1mvfxcm.rb extconf.rb
checking for sqlite3.h... no
sqlite3.h is missing. Try 'brew install sqlite3',
'yum install sqlite-devel' or 'apt-get install libsqlite3-dev'
and check your shared library search path (the
location where your sqlite3 shared library is located).
*** 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-sqlite3-config
        --without-sqlite3-config
        --with-pkg-config
        --without-pkg-config
        --with-sqlite3-dir
        --without-sqlite3-dir
        --with-sqlite3-include
        --without-sqlite3-include=${sqlite3-dir}/include
        --with-sqlite3-lib
        --without-sqlite3-lib=${sqlite3-dir}/lib

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/sqlite3-1.3.12/mkmf.log

extconf failed, exit code 1

In these error messages it say that I have to check the /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/sqlite3-1.3.12/mkmf.log file content, this is its content (that maybe could give some additional information to understand where is the probem):在这些错误消息中,它说我必须检查/var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/sqlite3-1.3.12/mkmf.log文件内容,这是它的内容(这也许可以提供一些额外的信息来了解问题在哪里):

package configuration for sqlite3 is not found
find_header: checking for sqlite3.h... -------------------- no

"gcc -o conftest -I/usr/include/x86_64-linux-gnu/ruby-2.3.0 -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -Wdate-t$
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

"gcc -E -I/usr/include/x86_64-linux-gnu/ruby-2.3.0 -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -Wdate-time -D_FO$
conftest.c:3:21: fatal error: sqlite3.h: No such file or directory
compilation terminated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <sqlite3.h>
/* end */

--------------------

So, reading the previous log file, it seems that the problem could be related to:因此,阅读以前的日志文件,似乎问题可能与:

  fatal error: sqlite3.h: No such file or directory

It seems that a C header file is missing but I really don't know why.似乎缺少一个 C 头文件,但我真的不知道为什么。

What am I missing?我错过了什么? How can I try to fix this issue?我该如何尝试解决这个问题?

I am not sure about what exactly is this bundler GEM that have to be installed我不确定必须安装的这个 bundler GEM 到底是什么

-> bundler is package manager for ruby code libraries aka ruby gems . -> bundler是 ruby​​ 代码库的包管理器,又名ruby gems


mysql gem would not install unless you install the binary dependencies of the library.除非您安装库的二进制依赖项,否则不会安装mysql gem。 try试试

$ sudo apt-get install libmysql-ruby libmysqlclient-dev

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

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