0

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

[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安装提供的gem。

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

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

1 回答 1

0

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

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

scl enable ruby193 'gem list'
scl enable ruby193 'gem uninstall -v 4.0.0 activerecord'
gem uninstall -v 2.9.1 mysql
于 2013-10-07T11:43:24.757 回答