在CENTOS中重新安装(捆绑/ mysql错误)

布鲁诺·桑托斯(Bruno Santos)

我正在遵循在CentOS中安装Redmine的指南。链接:(https://www.rosehosting.com/blog/how-to-install-redmine-on-centos-7/

在第六部分,我陷入了一个错误。

$ bundle install --without development test postgresql sqlite

结果是:

Your Gemfile lists the gem puma (>= 0) more than once.
You should probably keep only one of them.
Remove any duplicate entries and specify the gem only once (per group).
While it's not a problem now, it could cause errors if you change the version of one of them later.
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x64-mingw32, x86-mswin32. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x64-mingw32 x86-mswin32`.
Fetching gem metadata from https://rubygems.org/.............
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies......
Using rake 13.0.1
Using i18n 0.7.0
Using minitest 5.14.0
Using thread_safe 0.3.6
Using tzinfo 1.2.6
Using activesupport 4.2.11.1
Using builder 3.2.4
Using erubis 2.7.0
Using mini_portile2 2.3.0
Using nokogiri 1.8.5
Using rails-deprecated_sanitizer 1.0.3
Using rails-dom-testing 1.0.9
Using crass 1.0.6
Using loofah 2.4.0
Using rails-html-sanitizer 1.3.0
Using actionview 4.2.11.1
Using rack 1.6.12
Using rack-test 0.6.3
Using actionpack 4.2.11.1
Using globalid 0.4.2
Using activejob 4.2.11.1
Using mime-types-data 3.2019.1009
Using mime-types 3.3.1
Using mail 2.6.6
Using actionmailer 4.2.11.1
Using actionpack-xml_parser 1.0.2
Using activemodel 4.2.11.1
Using arel 6.0.4
Using activerecord 4.2.11.1
Using public_suffix 4.0.3
Using addressable 2.7.0
Using bundler 1.17.3
Using coderay 1.1.2
Using concurrent-ruby 1.1.5
Using css_parser 1.7.1
Using htmlentities 4.3.4
Using thor 1.0.1
Using railties 4.2.11.1
Using jquery-rails 3.1.5
Using mimemagic 0.3.3
Fetching mysql2 0.4.10
Installing mysql2 0.4.10 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /opt/redmine/.rvm/gems/ruby-2.3.8/gems/mysql2-0.4.10/ext/mysql2
/opt/redmine/.rvm/rubies/ruby-2.3.8/bin/ruby -I /opt/redmine/.rvm/rubies/ruby-2.3.8/lib/ruby/site_ruby/2.3.0 -r ./siteconf20200121-15610-14mtaat.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
-----
Using mysql_config at /bin/mysql_config
-----
checking for mysql.h... yes
checking for errmsg.h... yes
checking for SSL_MODE_DISABLED in mysql.h... no
checking for MYSQL_OPT_SSL_ENFORCE in mysql.h... yes
checking for MYSQL.net.vio in mysql.h... no
checking for MYSQL.net.pvio in mysql.h... yes
checking for MYSQL_ENABLE_CLEARTEXT_PLUGIN in mysql.h... yes
-----
Setting libpath to /usr/lib64/
-----
creating Makefile

current directory: /opt/redmine/.rvm/gems/ruby-2.3.8/gems/mysql2-0.4.10/ext/mysql2
make "DESTDIR=" clean

current directory: /opt/redmine/.rvm/gems/ruby-2.3.8/gems/mysql2-0.4.10/ext/mysql2
make "DESTDIR="
compiling client.c
In file included from ./mysql2_ext.h:35:0,
                 from client.c:1:
client.c: In function ‘rb_set_ssl_mode_option’:
./client.h:56:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
   mysql_client_wrapper *wrapper; \
   ^
client.c:118:3: note: in expansion of macro ‘GET_CLIENT’
   GET_CLIENT(self);
   ^~~~~~~~~~
client.c:119:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
   int val = NUM2INT( setting );
   ^~~
client.c:145:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
compiling infile.c
compiling mysql2_ext.c
compiling result.c
result.c: In function ‘rb_mysql_result_alloc_result_buffers’:
result.c:326:40: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]
     wrapper->result_buffers[i].is_null = &wrapper->is_null[i];
                                        ^
result.c:328:40: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]
     wrapper->result_buffers[i].error   = &wrapper->error[i];
                                        ^
result.c: In function ‘rb_mysql_result_fetch_row’:
result.c:589:14: warning: this statement may fall through [-Wimplicit-fallthrough=]
           if (args->castBool && fields[i].length == 1) {
              ^
result.c:593:9: note: here
         case MYSQL_TYPE_SHORT:      /* SMALLINT field */
         ^~~~
compiling statement.c
statement.c: In function ‘rb_raise_mysql2_stmt_error’:
statement.c:50:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
   VALUE rb_error_msg = rb_str_new2(mysql_stmt_error(stmt_wrapper->stmt));
   ^~~~~
statement.c:57:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
   rb_encoding *default_internal_enc = rb_default_internal_encoding();
   ^~~~~~~~~~~
In file included from ./mysql2_ext.h:35:0,
                 from statement.c:1:
statement.c: In function ‘execute’:
./client.h:56:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
   mysql_client_wrapper *wrapper; \
   ^
statement.c:273:3: note: in expansion of macro ‘GET_CLIENT’
   GET_CLIENT(stmt_wrapper->client);
   ^~~~~~~~~~
statement.c:405:13: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
             VALUE rb_val_as_string = rb_funcall(argv[i], intern_to_s, 0);
             ^~~~~
In file included from ./mysql2_ext.h:35:0,
                 from statement.c:1:
statement.c: In function ‘fields’:
./client.h:56:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
   mysql_client_wrapper *wrapper; \
   ^
statement.c:481:3: note: in expansion of macro ‘GET_CLIENT’
   GET_CLIENT(stmt_wrapper->client);
   ^~~~~~~~~~
linking shared-object mysql2/mysql2.so
/bin/ld: cannot find -lmariadb
collect2: error: ld returned 1 exit status
make: ** [mysql2.so] Erro 1

make failed, exit code 2

Gem files will remain installed in /opt/redmine/.rvm/gems/ruby-2.3.8/gems/mysql2-0.4.10 for inspection.
Results logged to /opt/redmine/.rvm/gems/ruby-2.3.8/extensions/x86_64-linux/2.3.0/mysql2-0.4.10/gem_make.out

An error occurred while installing mysql2 (0.4.10), and Bundler cannot continue.
Make sure that `gem install mysql2 -v '0.4.10' --source 'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  mysql2

之后,我尝试使用以下命令安装mysql2

$ gem install mysql2 -v '0.4.10' --source 'https://rubygems.org/'

然后发生另一个错误:

Building native extensions. This could take a while...
ERROR:  Error installing mysql2:
        ERROR: Failed to build gem native extension.

    current directory: /opt/redmine/.rvm/gems/ruby-2.3.8/gems/mysql2-0.4.10/ext/mysql2
/opt/redmine/.rvm/rubies/ruby-2.3.8/bin/ruby -I /opt/redmine/.rvm/rubies/ruby-2.3.8/lib/ruby/site_ruby/2.3.0 -r ./siteconf20200121-15921-15wh19l.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
-----
Using mysql_config at /bin/mysql_config
-----
checking for mysql.h... yes
checking for errmsg.h... yes
checking for SSL_MODE_DISABLED in mysql.h... no
checking for MYSQL_OPT_SSL_ENFORCE in mysql.h... yes
checking for MYSQL.net.vio in mysql.h... no
checking for MYSQL.net.pvio in mysql.h... yes
checking for MYSQL_ENABLE_CLEARTEXT_PLUGIN in mysql.h... yes
-----
Setting libpath to /usr/lib64/
-----
creating Makefile

current directory: /opt/redmine/.rvm/gems/ruby-2.3.8/gems/mysql2-0.4.10/ext/mysql2
make "DESTDIR=" clean

current directory: /opt/redmine/.rvm/gems/ruby-2.3.8/gems/mysql2-0.4.10/ext/mysql2
make "DESTDIR="
compiling client.c
In file included from ./mysql2_ext.h:35:0,
                 from client.c:1:
client.c: In function ‘rb_set_ssl_mode_option’:
./client.h:56:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
   mysql_client_wrapper *wrapper; \
   ^
client.c:118:3: note: in expansion of macro ‘GET_CLIENT’
   GET_CLIENT(self);
   ^~~~~~~~~~
client.c:119:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
   int val = NUM2INT( setting );
   ^~~
client.c:145:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
compiling infile.c
compiling mysql2_ext.c
compiling result.c
result.c: In function ‘rb_mysql_result_alloc_result_buffers’:
result.c:326:40: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]
     wrapper->result_buffers[i].is_null = &wrapper->is_null[i];
                                        ^
result.c:328:40: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]
     wrapper->result_buffers[i].error   = &wrapper->error[i];
                                        ^
result.c: In function ‘rb_mysql_result_fetch_row’:
result.c:589:14: warning: this statement may fall through [-Wimplicit-fallthrough=]
           if (args->castBool && fields[i].length == 1) {
              ^
result.c:593:9: note: here
         case MYSQL_TYPE_SHORT:      /* SMALLINT field */
         ^~~~
compiling statement.c
statement.c: In function ‘rb_raise_mysql2_stmt_error’:
statement.c:50:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
   VALUE rb_error_msg = rb_str_new2(mysql_stmt_error(stmt_wrapper->stmt));
   ^~~~~
statement.c:57:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
   rb_encoding *default_internal_enc = rb_default_internal_encoding();
   ^~~~~~~~~~~
In file included from ./mysql2_ext.h:35:0,
                 from statement.c:1:
statement.c: In function ‘execute’:
./client.h:56:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
   mysql_client_wrapper *wrapper; \
   ^
statement.c:273:3: note: in expansion of macro ‘GET_CLIENT’
   GET_CLIENT(stmt_wrapper->client);
   ^~~~~~~~~~
statement.c:405:13: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
             VALUE rb_val_as_string = rb_funcall(argv[i], intern_to_s, 0);
             ^~~~~
In file included from ./mysql2_ext.h:35:0,
                 from statement.c:1:
statement.c: In function ‘fields’:
./client.h:56:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
   mysql_client_wrapper *wrapper; \
   ^
statement.c:481:3: note: in expansion of macro ‘GET_CLIENT’
   GET_CLIENT(stmt_wrapper->client);
   ^~~~~~~~~~
linking shared-object mysql2/mysql2.so
/bin/ld: cannot find -lmariadb
collect2: error: ld returned 1 exit status
make: ** [mysql2.so] Erro 1

make failed, exit code 2

Gem files will remain installed in /opt/redmine/.rvm/gems/ruby-2.3.8/gems/mysql2-0.4.10 for inspection.
Results logged to /opt/redmine/.rvm/gems/ruby-2.3.8/extensions/x86_64-linux/2.3.0/mysql2-0.4.10/gem_make.out

提前致谢!!(对不起,我拼错了什么)

亚历山大·帕维奇(AleksandarPavić)

这是常见错误,gem试图在您的服务器上进行编译,并且似乎您的centos缺少mysql / mariadb开发标头。

要解决此问题,只需以根用户身份运行此命令:

yum install -y mariadb-devel mariadb-shared

然后重试

gem install mysql2 -v '0.4.10' --source 'https://rubygems.org/'

根据建议...

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

Rails 3.2-Ruby重新安装后,由于Gemnasium错误,“捆绑安装”失败

来自分类Dev

在Rails中,重新安装Devise时出现错误

来自分类Dev

我在重新安装 mysql 时遇到此错误

来自分类Dev

AVG错误(重新安装ubuntu)

来自分类Dev

如何完全重新安装mysql?

来自分类Dev

无法重新安装MySQL

来自分类Dev

无法重新安装MySQL

来自分类Dev

在appium程序中需要重新安装时显示错误为“ app”选项

来自分类Dev

我错误地删除了Blogger中的标题小部件。如何重新安装?

来自分类Dev

重新安装后,VLC在错误的目录中寻找插件

来自分类Dev

重新安装MySQL后,为什么不能在列中插入NULL值?

来自分类Dev

如何在Cloud 9 IDE中重新安装MySQL

来自分类Dev

重新安装12.04时出现奇怪的错误

来自分类Dev

重新安装后出现Python-pip错误

来自分类Dev

重新安装时解决Firefox dpkg错误

来自分类Dev

重新安装后gcloud执行错误

来自分类Dev

重新安装Grub时出现此错误

来自分类Dev

错误的更新重新安装ubuntu保持回家

来自分类Dev

重新安装16.04时出现内部错误

来自分类Dev

无法重新安装Ubuntu,仅收到错误消息

来自分类Dev

重新安装MySQL或重置其根密码

来自分类Dev

重新安装MySQL后还原数据库

来自分类Dev

无法在Ubuntu上重新安装mysql

来自分类Dev

无法在OSX Mavericks上重新安装mysql

来自分类Dev

无法卸载并重新安装MySQL

来自分类Dev

使用mysql数据文件重新安装

来自分类Dev

如何删除并重新安装MySql(重新安装不会恢复已删除的“ root”用户。)

来自分类Dev

重新安装Anaconda之后,OpenCV C ++二进制文件中的链接器错误

来自分类Dev

我如何解决不删除并重新安装而不在MAMP中启动的MySQL?

Related 相关文章

热门标签

归档