gpt4 book ai didi

linux - 工头数据库导入失败

转载 作者:太空宇宙 更新时间:2023-11-04 04:11:34 24 4
gpt4 key购买 nike

我已经在 centos 6 上使用 yum repo 安装了 foreman

[root@server roor]# cat /etc/yum.repos.d/foreman.repo 
[foreman]
name=Foreman Repo
baseurl=http://yum.theforeman.org/releases/latest/el6/x86_64/
gpgcheck=0
enabled=1

并将database.yml配置为

production:
adapter: mysql
database: foreman
username: foreman
password: xxxxxx
encoding: utf8

但是在构建表格时出现此错误,有什么想法吗?

[root@server foreman]# sudo RAILS_ENV=production rake db:migrate
(in /usr/share/foreman)
rake aborted!
no such file to load -- rails/all
/usr/share/foreman/Rakefile:1
(See full trace by running task with --trace)
[root@serverforeman]#

更新:修复使用

[root@server foreman]# cat /opt/rh/ruby193/enable 
export PATH=/opt/rh/ruby193/root/usr/bin:$PATH
export LD_LIBRARY_PATH=/opt/rh/ruby193/root/usr/lib64:$LD_LIBRARY_PATH
export MANPATH=/opt/rh/ruby193/root/usr/share/man:$MANPATH

但现在它卡在了......

[root@server foreman]# RAILS_ENV=production rake db:migrate --trace
rake aborted!
undefined method `active_record' for #<Rails::Application::Configuration:0x00000003ad8358>
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/railtie/configuration.rb:85:in `method_missing'
/usr/share/foreman/config/application.rb:57:in `<class:Application>'
/usr/share/foreman/config/application.rb:37:in `<module:Foreman>'
/usr/share/foreman/config/application.rb:36:in `<top (required)>'
/opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
/opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
/usr/share/foreman/Rakefile:1:in `<top (required)>'
/opt/rh/ruby193/root/usr/share/ruby/rake/rake_module.rb:25:in `load'
/opt/rh/ruby193/root/usr/share/ruby/rake/rake_module.rb:25:in `load_rakefile'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:501:in `raw_load_rakefile'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:82:in `block in load_rakefile'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:133:in `standard_exception_handling'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:81:in `load_rakefile'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:65:in `block in run'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:133:in `standard_exception_handling'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:63:in `run'
/opt/rh/ruby193/root/usr/bin/rake:32:in `<main>'

已修复:

目前,如果安装了多个版本的activerecord/mysql,foreman将会出现问题,应该使用foreman安装时提供的gems。

所以这些是删除不必要的 gem 的步骤

scl enable ruby193 'gem list'
scl enable ruby193 'gem uninstall -v 4.0.0 activerecord'
gem uninstall -v 2.9.1 mysql

最佳答案

目前,如果安装了多个版本的activerecord/mysql,foreman将会出现问题,应该使用foreman安装时提供的gems。

所以这些是删除不必要的 gem 的步骤

scl enable ruby193 'gem list'
scl enable ruby193 'gem uninstall -v 4.0.0 activerecord'
gem uninstall -v 2.9.1 mysql

关于linux - 工头数据库导入失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18846562/

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