Upgrade to 1.5

Hi,
started upgrading to ver 1.5.

after the rpm update trying to run db migrate and getting the next error

rake aborted!
undefined method `in_rake?' for Foreman:Module

please advice

> Hi,
> started upgrading to ver 1.5.
>
> after the rpm update trying to run db migrate and getting the next error
>
> rake aborted!
> undefined method `in_rake?' for Foreman:Module
>

can you please send a full trace? and how are you executing rake, is it
using foreman-rake?

Ohad

··· On Sun, May 11, 2014 at 3:15 PM, eliran shlomo wrote:

please advice


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.

Hi,
yes, i did it with foreman-rake

trace:

rake aborted!
undefined method `in_rake?' for Foreman:Module

Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)
[root@ptkpl-foreman ~]# foreman-rake db:migrate --trace
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
undefined method in_rake?&#39; for Foreman:Module /usr/share/foreman/config/initializers/fix_cache.rb:8:in<top (required)>'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:245:in
load&#39; /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:245:inblock in load'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236:in
load_dependency&#39; /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:245:inload'
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/engine.rb:588:in
block (2 levels) in &lt;class:Engine&gt;&#39; /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/engine.rb:587:ineach'
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/engine.rb:587:in
block in &lt;class:Engine&gt;&#39; /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/initializable.rb:30:ininstance_exec'
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/initializable.rb:30:in
run&#39; /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/initializable.rb:55:inblock in run_initializers'
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/initializable.rb:54:in
each&#39; /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/initializable.rb:54:inrun_initializers'
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/application.rb:136:in
initialize!&#39; /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/railtie/configurable.rb:30:inmethod_missing'
/usr/share/foreman/config/environment.rb:5:in &lt;top (required)&gt;&#39; /opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:inrequire'
/opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in
require&#39; /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:inblock in require'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236:in
load_dependency&#39; /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:inrequire'
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/application.rb:103:in
require_environment!&#39; /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/application.rb:295:inblock (2 levels) in initialize_tasks'
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:205:in call&#39; /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:205:inblock in execute'
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:200:in each&#39; /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:200:inexecute'
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:158:in block in invoke_with_call_chain&#39; /opt/rh/ruby193/root/usr/share/ruby/monitor.rb:211:inmon_synchronize'
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:151:in
invoke_with_call_chain&#39; /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:176:inblock in
invoke_prerequisites'
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:174:in each&#39; /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:174:ininvoke_prerequisites'
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:157:in block in invoke_with_call_chain&#39; /opt/rh/ruby193/root/usr/share/ruby/monitor.rb:211:inmon_synchronize'
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:151:in
invoke_with_call_chain&#39; /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:144:ininvoke'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:116:in invoke_task&#39; /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:94:inblock (2
levels) in top_level'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:94:in each&#39; /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:94:inblock in
top_level'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:133:in
standard_exception_handling&#39; /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:88:intop_level'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:66:in block in run&#39; /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:133:instandard_exception_handling'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:63:in run&#39; /opt/rh/ruby193/root/usr/bin/rake:32:in<main>'
Tasks: TOP => db:migrate => environment

··· On Sunday, May 11, 2014 4:11:40 PM UTC+3, ohad wrote: > > > > > On Sun, May 11, 2014 at 3:15 PM, eliran shlomo <eliran...@gmail.com > > wrote: > >> Hi, >> started upgrading to ver 1.5. >> >> after the rpm update trying to run db migrate and getting the next error >> >> rake aborted! >> undefined method `in_rake?' for Foreman:Module >> > > can you please send a full trace? and how are you executing rake, is it > using foreman-rake? > > Ohad > >> >> please advice >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Foreman users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to foreman-user...@googlegroups.com . >> To post to this group, send email to forema...@googlegroups.com >> . >> Visit this group at http://groups.google.com/group/foreman-users. >> For more options, visit https://groups.google.com/d/optout. >> > >

Try an "rpm -V foreman" to verify your installation and see if
/usr/share/foreman/lib/foreman.rb is reported as modified or not.

If you need to restore it for some reason, get a copy from here, or yum
reinstall foreman:
https://raw.githubusercontent.com/theforeman/foreman/1.5-stable/lib/foreman.rb

··· -- Dominic Cleal Red Hat Engineering

On 12/05/14 11:41, eliran shlomo wrote:

Hi,
yes, i did it with foreman-rake

trace:

rake aborted!
undefined method `in_rake?’ for Foreman:Module

Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)
[root@ptkpl-foreman ~]# foreman-rake db:migrate --trace
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
undefined method in_rake?' for Foreman:Module /usr/share/foreman/config/initializers/fix_cache.rb:8:in<top (required)>’
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:245:in
load' /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:245:inblock in load’
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236:in
load_dependency' /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:245:inload’
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/engine.rb:588:in
block (2 levels) in <class:Engine>' /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/engine.rb:587:ineach’
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/engine.rb:587:in
block in <class:Engine>' /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/initializable.rb:30:ininstance_exec’
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/initializable.rb:30:in
run' /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/initializable.rb:55:inblock in run_initializers’
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/initializable.rb:54:in
each' /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/initializable.rb:54:inrun_initializers’
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/application.rb:136:in
initialize!' /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/railtie/configurable.rb:30:inmethod_missing’
/usr/share/foreman/config/environment.rb:5:in <top (required)>' /opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:inrequire’
/opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in
require' /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:inblock in require’
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236:in
load_dependency' /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:inrequire’
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/application.rb:103:in
require_environment!' /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/application.rb:295:inblock (2 levels) in initialize_tasks’
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:205:in call' /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:205:inblock in execute’
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:200:in each' /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:200:inexecute’
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:158:in block in invoke_with_call_chain' /opt/rh/ruby193/root/usr/share/ruby/monitor.rb:211:inmon_synchronize’
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:151:in
invoke_with_call_chain' /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:176:inblock in
invoke_prerequisites’
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:174:in each' /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:174:ininvoke_prerequisites’
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:157:in block in invoke_with_call_chain' /opt/rh/ruby193/root/usr/share/ruby/monitor.rb:211:inmon_synchronize’
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:151:in
invoke_with_call_chain' /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:144:ininvoke’
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:116:in invoke_task' /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:94:inblock (2
levels) in top_level’
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:94:in each' /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:94:inblock in
top_level’
/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:88:intop_level’
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:66:in block in run' /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:133:instandard_exception_handling’
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:63:in run' /opt/rh/ruby193/root/usr/bin/rake:32:in'
Tasks: TOP => db:migrate => environment

On Sunday, May 11, 2014 4:11:40 PM UTC+3, ohad wrote:

On Sun, May 11, 2014 at 3:15 PM, eliran shlomo <eliran...@gmail.com >     <javascript:>> wrote:

    Hi,
    started upgrading to ver 1.5.

    after the rpm update trying to run db migrate and getting the
    next error

    rake aborted!
    undefined method `in_rake?' for Foreman:Module


can you please send a full trace? and how are you executing rake, is
it using foreman-rake?

Ohad 


    please advice

    -- 
    You received this message because you are subscribed to the
    Google Groups "Foreman users" group.
    To unsubscribe from this group and stop receiving emails from
    it, send an email to foreman-user...@googlegroups.com <javascript:>.
    To post to this group, send email to forema...@googlegroups.com
    <javascript:>.
    Visit this group at http://groups.google.com/group/foreman-users
    <http://groups.google.com/group/foreman-users>.
    For more options, visit https://groups.google.com/d/optout
    <https://groups.google.com/d/optout>.


You received this message because you are subscribed to the Google
Groups “Foreman users” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to foreman-users+unsubscribe@googlegroups.com
mailto:foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com
mailto:foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.

Hi,
the yum had a problem i missied
error: unpacking of archive failed on file
/usr/share/foreman/config/settings.plugins.d: cpio: rename
after rename the settings.plugins.d directory reinstall solved the problem

··· On Monday, May 12, 2014 1:48:53 PM UTC+3, Dominic Cleal wrote: > > Try an "rpm -V foreman" to verify your installation and see if > /usr/share/foreman/lib/foreman.rb is reported as modified or not. > > If you need to restore it for some reason, get a copy from here, or yum > reinstall foreman: > > https://raw.githubusercontent.com/theforeman/foreman/1.5-stable/lib/foreman.rb > > -- > Dominic Cleal > Red Hat Engineering > > On 12/05/14 11:41, eliran shlomo wrote: > > Hi, > > yes, i did it with foreman-rake > > > > trace: > > > > rake aborted! > > undefined method `in_rake?' for Foreman:Module > > > > Tasks: TOP => db:migrate => environment > > (See full trace by running task with --trace) > > [root@ptkpl-foreman ~]# foreman-rake db:migrate --trace > > ** Invoke db:migrate (first_time) > > ** Invoke environment (first_time) > > ** Execute environment > > rake aborted! > > undefined method `in_rake?' for Foreman:Module > > /usr/share/foreman/config/initializers/fix_cache.rb:8:in ` (required)>' > > > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:245:in > > > `load' > > > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:245:in > > > `block in load' > > > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236:in > > > `load_dependency' > > > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:245:in > > > `load' > > > /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/engine.rb:588:in > > > `block (2 levels) in ' > > > /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/engine.rb:587:in > > > `each' > > > /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/engine.rb:587:in > > > `block in ' > > > /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/initializable.rb:30:in > > > `instance_exec' > > > /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/initializable.rb:30:in > > > `run' > > > /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/initializable.rb:55:in > > > `block in run_initializers' > > > /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/initializable.rb:54:in > > > `each' > > > /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/initializable.rb:54:in > > > `run_initializers' > > > /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/application.rb:136:in > > > `initialize!' > > > /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/railtie/configurable.rb:30:in > > > `method_missing' > > /usr/share/foreman/config/environment.rb:5:in `' > > /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' > > > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in > > > `block in require' > > > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236:in > > > `load_dependency' > > > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in > > > `require' > > > /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/application.rb:103:in > > > `require_environment!' > > > /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/application.rb:295:in > > > `block (2 levels) in initialize_tasks' > > /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:205:in `call' > > /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:205:in `block in > execute' > > /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:200:in `each' > > /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:200:in `execute' > > /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:158:in `block in > > invoke_with_call_chain' > > /opt/rh/ruby193/root/usr/share/ruby/monitor.rb:211:in `mon_synchronize' > > /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:151:in > > `invoke_with_call_chain' > > /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:176:in `block in > > invoke_prerequisites' > > /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:174:in `each' > > /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:174:in > > `invoke_prerequisites' > > /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:157:in `block in > > invoke_with_call_chain' > > /opt/rh/ruby193/root/usr/share/ruby/monitor.rb:211:in `mon_synchronize' > > /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:151:in > > `invoke_with_call_chain' > > /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:144:in `invoke' > > /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:116:in > `invoke_task' > > /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:94:in `block (2 > > levels) in top_level' > > /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:94:in `each' > > /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:94:in `block in > > top_level' > > /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:88:in > `top_level' > > /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:66: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 `' > > Tasks: TOP => db:migrate => environment > > > > > > On Sunday, May 11, 2014 4:11:40 PM UTC+3, ohad wrote: > > > > > > > > > > On Sun, May 11, 2014 at 3:15 PM, eliran shlomo > > wrote: > > > > Hi, > > started upgrading to ver 1.5. > > > > after the rpm update trying to run db migrate and getting the > > next error > > > > rake aborted! > > undefined method `in_rake?' for Foreman:Module > > > > > > can you please send a full trace? and how are you executing rake, is > > it using foreman-rake? > > > > Ohad > > > > > > please advice > > > > -- > > You received this message because you are subscribed to the > > Google Groups "Foreman users" group. > > To unsubscribe from this group and stop receiving emails from > > it, send an email to foreman-user...@googlegroups.com. > > To post to this group, send email to forema...@googlegroups.com > > . > > Visit this group at http://groups.google.com/group/foreman-users > > . > > For more options, visit https://groups.google.com/d/optout > > . > > > > > > -- > > You received this message because you are subscribed to the Google > > Groups "Foreman users" group. > > To unsubscribe from this group and stop receiving emails from it, send > > an email to foreman-user...@googlegroups.com > > <mailto:foreman-users+unsubscribe@googlegroups.com >. > > To post to this group, send email to forema...@googlegroups.com > > <mailto:forema...@googlegroups.com >. > > Visit this group at http://groups.google.com/group/foreman-users. > > For more options, visit https://groups.google.com/d/optout. > >

Apologies, please ignore my comment about restoring foreman.rb.

We found on IRC that this error can happen if your RPM upgrade had
partially failed. This tends to happen due to a bug (#5482) around the
plugin settings directory.

Please check the yum output to be sure, but then try backing up the
contents of /usr/share/foreman/config/settings.plugins.d, deleting that
whole directory and doing the "yum upgrade foreman* ruby*" again.
Once upgraded, you can restore those config files to the new directory
at /etc/foreman/plugins/.

··· -- Dominic Cleal Red Hat Engineering

On 12/05/14 11:48, Dominic Cleal wrote:

Try an “rpm -V foreman” to verify your installation and see if
/usr/share/foreman/lib/foreman.rb is reported as modified or not.

If you need to restore it for some reason, get a copy from here, or yum
reinstall foreman:
https://raw.githubusercontent.com/theforeman/foreman/1.5-stable/lib/foreman.rb