【发布时间】:2023-10-17 01:54:01
【问题描述】:
我正在尝试按照本指南将 Rails 应用程序上传到 hostgator: http://support.hostgator.com/articles/specialized-help/technical/how-do-i-start-using-ruby-on-rails 我在第 5.6 点遇到错误。当我这样做时:
rake generate_session_store
它说找不到 gem 'rack' 并建议我运行捆绑安装。当我这样做时:
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 /home4/agtcorp/ruby/gems/gems/mysql-2.9.1 for inspection.
An error ocurred 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' 。 我联系了 Hostgator 支持,一位 linux 管理员对我说:
'我看到您的问题是由于声明的路径不正确。 Rakefile 当前位于 /home4/agtcorp/rails_apps/agtcorp2/。也许如果你更新 安装要使用正确的路径,它会在 完整文件路径 /home4/agtcorp/rails_apps/agtcorp2/Rakefile。'
我不知道该怎么做。请帮忙!
【问题讨论】:
-
第 0 步:寻找一个新的主机,因为 HostGator 对 Rails 的特别支持和对 Ruby 的普遍支持不好。您将全程与他们的基础设施作斗争。
标签: ruby-on-rails ruby rack gemfile