gpt4 book ai didi

MySQL 和 MySQL2 gem 在主机上构建,但不通过 Capistrano 或 SSH 构建

转载 作者:行者123 更新时间:2023-11-29 00:57:59 26 4
gpt4 key购买 nike

我正在尝试通过 Capistrano 部署一个使用 Bundler 的 Rails 应用。

运行 cap deploy:cold 得到这个:

** [out :: (my host)] Installing mysql2 (0.2.6)  
** [out :: (my host)] with native extensions
*** [err :: (my host)] /usr/lib64/ruby/site_ruby/1.8/rubygems/installer.rb:483:in `build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
*** [err :: (my host)]
*** [err :: (my host)] /usr/bin/ruby extconf.rb
*** [err :: (my host)] checking for rb_thread_blocking_region()... no
*** [err :: (my host)] checking for mysql_query() in -lmysqlclient... no
*** [err :: (my host)] checking for main() in -lm... yes
*** [err :: (my host)] checking for mysql_query() in -lmysqlclient... no
*** [err :: (my host)] checking for main() in -lz... yes
*** [err :: (my host)] checking for mysql_query() in -lmysqlclient... no
*** [err :: (my host)] checking for main() in -lsocket... no
*** [err :: (my host)] checking for mysql_query() in -lmysqlclient... no
*** [err :: (my host)] checking for main() in -lnsl... yes
*** [err :: (my host)] checking for mysql_query() in -lmysqlclient... no
*** [err :: (my host)] checking for main() in -lmygcc... no
*** [err :: (my host)] checking for mysql_query() in -lmysqlclient... no
*** [err :: (my host)] *** extconf.rb failed ***
*** [err :: (my host)] Could not create Makefile due to some reason, probably lack of
*** [err :: (my host)] necessary libraries and/or headers. Check the mkmf.log file for more
*** [err :: (my host)] details. You may need configuration options.

只需安装 mysql-dev 软件包或其他东西,对吗?不完全是因为 gems(mysql 和 mysql2)都在使用 Bundler 的机器上构建而没有任何问题,而且其他 gems 安装也没有任何问题。

Capistrano 有什么不同之处?

最佳答案

可能是没有像直接登录一样加载shell环境,所以找不到mysqlclient库。

通常它希望能够找到可以为它提供该信息的 mysql_config。如果您能弄清楚如何将 --with-mysql-config=/path/to/mysql_config 传递给构建器,我想它可能会有所帮助。我以前这样做过:gem install mysql2 -- --with-mysql-config=/path/to/mysql_config

我不确定如何让 bundler 做到这一点,但我希望这些信息有所帮助

关于MySQL 和 MySQL2 gem 在主机上构建,但不通过 Capistrano 或 SSH 构建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5086606/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com