gpt4 book ai didi

mysql - 在 Linux 服务器上使用 Mysql 安装 Rails 应用程序时出现问题

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:08:01 26 4
gpt4 key购买 nike

我一直在关注 Host Gator 上的支持指南我在第 5 步。

这是我在终端中遇到的第一个问题:

user@domain.com [~/rails_apps/app_name]# bundle install
Fetching gem metadata from http://rubygems.org/.......
Using rake (0.8.3)
Using RedCloth (4.2.9)
Using coderay (0.9.8)
Using hoe (3.13.1)
Using i18n (0.4.2)
Using minitest (1.7.2)
Installing mysql (2.9.1) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

/usr/bin/ruby extconf.rb
checking for mysql_ssl_set()... no
checking for rb_str_set_len()... no
checking for rb_thread_start_timer()... no
checking for mysql.h... no
checking for mysql/mysql.h... no
*** 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
--with-mysql-config
--without-mysql-config


Gem files will remain installed in /home3/user/ruby/gems/gems/mysql-2.9.1 for inspection.
Results logged to /home3/user/ruby/gems/gems/mysql-2.9.1/ext/mysql_api/gem_make.out
An error occured while installing mysql (2.9.1), and Bundler cannot continue.
Make sure that `gem install mysql -v '2.9.1'` succeeds before bundling.

然后我尝试使用 'gem install mysql -v '2.9.1':

user@domain.com [~/rails_apps/app_name]# gem install mysql -v '2.9.1'
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.

/usr/bin/ruby extconf.rb
checking for mysql_ssl_set()... no
checking for rb_str_set_len()... no
checking for rb_thread_start_timer()... no
checking for mysql.h... no
checking for mysql/mysql.h... no
*** 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
--with-mysql-config
--without-mysql-config


Gem files will remain installed in /home3/user/ruby/gems/gems/mysql-2.9.1 for inspection.
Results logged to /home3/user/ruby/gems/gems/mysql-2.9.1/ext/mysql_api/gem_make.out

我尝试使用以下方法更改文件夹的权限:

chown root:root user/bin/sudo 

没有任何运气。

这是我需要从 Host Gator 那里获得帮助的事情吗?

最佳答案

假设你在 Linux 上,你需要安装 mysql 开发库/头文件来编译 native 扩展:

sudo apt-get install libmysqlclient-dev

根据 linux 版本,您可能需要安装其他开发库。错误消息是否像这样:

checking for mysql.h... no

这表明您的盒子缺少相应的开发人员库/ header (在这种特殊情况下为 mysql。)

关于mysql - 在 Linux 服务器上使用 Mysql 安装 Rails 应用程序时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30092763/

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