Question

I have installed foreman on centos 6, using the yum repo

[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

and configured database.yml as

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

however while building the tables, gives this error, any ideas?

[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]# 

UPDATED: fixed using

[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

but now its stuck on....

[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>'

FIXED:

currently foreman will have problems if there are multiple version of activerecord/ mysql installed, and one should use the gems supplied with the foreman installation.

so these were the steps to remove the unnecessary gems

scl enable ruby193 'gem list'
scl enable ruby193 'gem uninstall -v 4.0.0 activerecord'
gem uninstall -v 2.9.1 mysql
Était-ce utile?

La solution

currently foreman will have problems if there are multiple version of activerecord/ mysql installed, and one should use the gems supplied with the foreman installation.

so these were the steps to remove the unnecessary gems

scl enable ruby193 'gem list'
scl enable ruby193 'gem uninstall -v 4.0.0 activerecord'
gem uninstall -v 2.9.1 mysql
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top