Really messed up foreman

I was doing some Sunday night testing and decided to start playing with
creating Foreman plugins. I followed this
example How to Create a Plugin - Foreman.

I ended up getting the plugin to show up in Foreman but when I cam into
work and restarted the foreman service I got this error:
[root@foreman share]# service foreman restart
Stopping foreman: Foreman was not running. [FAILED]

Starting foreman:
/opt/rh/ruby193/root/usr/share/gems/gems/bundler_ext-0.3.0/lib/bundler_ext/bundler_ext.rb:30:in
strict_error': Gem loading error: cannot load such file -- audited/activerecord (RuntimeError) from /opt/rh/ruby193/root/usr/share/gems/gems/bundler_ext-0.3.0/lib/bundler_ext/bundler_ext.rb:53:inrescue in rescue in block in system_require'
from
/opt/rh/ruby193/root/usr/share/gems/gems/bundler_ext-0.3.0/lib/bundler_ext/bundler_ext.rb:43:in
rescue in block in system_require' from /opt/rh/ruby193/root/usr/share/gems/gems/bundler_ext-0.3.0/lib/bundler_ext/bundler_ext.rb:37:inblock in system_require'
from
/opt/rh/ruby193/root/usr/share/gems/gems/bundler_ext-0.3.0/lib/bundler_ext/bundler_ext.rb:35:in
each' from /opt/rh/ruby193/root/usr/share/gems/gems/bundler_ext-0.3.0/lib/bundler_ext/bundler_ext.rb:35:insystem_require'
from /usr/share/foreman/config/application.rb:13:in <top (required)>' from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:55:inrequire'
from
/opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:55:in
require&#39; from /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/commands.rb:53:inblock in <top (required)>'
from
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/commands.rb:50:in
tap&#39; from /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/commands.rb:50:in<top (required)>'
from
/opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:60:in
require&#39; from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:60:inrescue in require'
from
/opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:35:in
require&#39; from /usr/share/foreman/script/rails:6:in<main>'
[FAILED]

I'm new to ruby but I'm absolutely sure that I messed up a bunch of gems in
learning how to get my plugin to work. Can anyone help?

RHEL 6.5
Foreman 1.7.4

More useful stuff:
[root@foreman share]# scl enable ruby193 "gem list"

*** LOCAL GEMS ***

actionmailer (4.2.1, 3.2.21, 3.2.8)
actionpack (4.2.1, 3.2.21, 3.2.8)
actionview (4.2.1)
activejob (4.2.1)
activemodel (4.2.1, 3.2.21, 3.2.8)
activerecord (3.2.21, 3.2.8)
activeresource (3.2.21, 3.2.8)
activesupport (4.2.1, 3.2.21, 3.2.8)
ancestry (2.0.0)
apipie-rails (0.2.6)
arel (6.0.0, 3.0.3, 3.0.2)
audited (3.0.0)
audited-activerecord (3.0.0)
awesome_print (1.6.1, 1.0.2)
bigdecimal (1.1.0)
bootstrap-sass (3.0.3.0)
builder (3.2.2, 3.0.4, 3.0.0)
bundler (1.3.5)
bundler_ext (0.3.0)
coffee-rails (3.2.2)
coffee-script (2.2.0)
coffee-script-source (1.3.3)
colorize (0.7.5)
daemon_controller (1.1.4)
daemons (1.1.4)
deep_cloneable (2.1.1, 2.0.0)
deface (0.7.2)
diff-lcs (1.1.3)
erubis (2.7.0)
eventmachine (0.12.10)
excon (0.45.1, 0.38.0)
execjs (1.4.0)
fast_gettext (0.9.2, 0.8.0)
fog (1.24.0)
fog-brightbox (0.7.1, 0.0.1)
fog-core (1.24.0)
fog-json (1.0.1, 1.0.0)
fog-radosgw (0.0.4, 0.0.3)
fog-sakuracloud (1.0.1, 0.1.1)
fog-softlayer (0.4.5, 0.3.9)
fog-xml (0.1.2, 0.1.0)
foreigner (1.4.2)
formatador (0.2.5, 0.2.1)
friendly_id (4.0.10.1)
ftools (0.0.0)
gettext_i18n_rails (0.10.0)
gettext_i18n_rails_js (0.0.8)
globalid (0.3.5)
hike (1.2.3, 1.2.1)
hirb (0.7.3, 0.7.0)
hirb-unicode (0.0.5)
i18n (0.7.0, 0.6.0)
i18n_data (0.2.7)
inflecto (0.0.2)
io-console (0.3)
ipaddress (0.8.0)
journey (1.0.4)
jquery-rails (2.0.2)
jquery-ui-rails (4.1.2)
json (1.8.2, 1.5.5)
ldap_fluff (0.3.4, 0.3.3)
loofah (2.0.1)
mail (2.6.3, 2.5.4, 2.4.4)
mime-types (1.25.1, 1.19)
mini_portile (0.6.2)
minitest (5.5.1, 4.7.5, 3.5.0)
multi_json (1.11.0, 1.8.2)
my_plugin (0.0.1)
net-http-persistent (2.7)
net-ldap (0.11, 0.3.1)
net-scp (1.2.1, 1.1.0)
net-ssh (2.9.2, 2.6.7)
netrc (0.7.7)
nokogiri (1.6.6.2, 1.5.11)
oauth (0.4.7)
open4 (1.3.0)
paint (1.0.0)
passenger (4.0.18)
pg (0.18.1, 0.12.2)
po_to_json (0.0.7)
polyglot (0.3.5, 0.3.3)
rabl (0.9.0)
rack (1.4.5, 1.4.1)
rack-cache (1.2)
rack-ssl (1.3.4, 1.3.2)
rack-test (0.6.3, 0.6.1)
rails (3.2.21, 3.2.8)
rails-deprecated_sanitizer (1.0.3)
rails-dom-testing (1.0.6)
rails-html-sanitizer (1.0.2)
rails-observers (0.1.2)
railties (4.2.1, 3.2.21, 3.2.8)
rake (10.4.2, 0.9.2.2)
rbovirt (0.0.35, 0.0.29)
rdoc (3.12.2, 3.12)
ref (1.0.0)
rest-client (1.6.8, 1.6.7)
ruby-hmac (0.4.0)
ruby-libvirt (0.5.2, 0.5.1)
ruby2ruby (2.1.3, 2.0.1)
ruby_parser (3.6.5, 3.1.1, 3.0.4)
safemode (1.2.2, 1.2.1)
sass (3.2.13)
sass-rails (3.2.5)
scoped_search (2.7.1)
secure_headers (1.3.4, 1.3.3)
sexp_processor (4.5.0, 4.1.3)
sprockets (2.8.2, 2.2.3)
sprockets-rails (2.2.4)
sqlite3 (1.3.10)
therubyracer (0.11.0beta5)
thin (1.3.1)
thor (0.19.1, 0.18.1)
thread_safe (0.3.5)
tilt (1.4.1, 1.3.3)
treetop (1.4.15, 1.4.10)
twitter-bootstrap-rails (2.2.6)
tzinfo (1.2.2, 0.3.43, 0.3.33)
uglifier (1.2.6)
unf (0.1.4, 0.1.3)
unf_ext (0.0.6)
unicode-display_width (0.1.1)
uuidtools (2.1.5, 2.1.3)
validates_lengths_from_database (0.2.0)
will_paginate (3.0.7, 3.0.2)
wirb (0.4.2)

[root@foreman share]# rpm -V foreman
[root@foreman share]#

··· On Monday, April 13, 2015 at 1:39:34 PM UTC-4, Edson Manners wrote: > > I was doing some Sunday night testing and decided to start playing with > creating Foreman plugins. I followed this example > http://projects.theforeman.org/projects/foreman/wiki/How_to_Create_a_Plugin > . > > I ended up getting the plugin to show up in Foreman but when I cam into > work and restarted the foreman service I got this error: > [root@foreman share]# service foreman restart > Stopping foreman: Foreman was not running. [FAILED] > > Starting foreman: > /opt/rh/ruby193/root/usr/share/gems/gems/bundler_ext-0.3.0/lib/bundler_ext/bundler_ext.rb:30:in > `strict_error': Gem loading error: cannot load such file -- > audited/activerecord (RuntimeError) > from > /opt/rh/ruby193/root/usr/share/gems/gems/bundler_ext-0.3.0/lib/bundler_ext/bundler_ext.rb:53:in > `rescue in rescue in block in system_require' > from > /opt/rh/ruby193/root/usr/share/gems/gems/bundler_ext-0.3.0/lib/bundler_ext/bundler_ext.rb:43:in > `rescue in block in system_require' > from > /opt/rh/ruby193/root/usr/share/gems/gems/bundler_ext-0.3.0/lib/bundler_ext/bundler_ext.rb:37:in > `block in system_require' > from > /opt/rh/ruby193/root/usr/share/gems/gems/bundler_ext-0.3.0/lib/bundler_ext/bundler_ext.rb:35:in > `each' > from > /opt/rh/ruby193/root/usr/share/gems/gems/bundler_ext-0.3.0/lib/bundler_ext/bundler_ext.rb:35:in > `system_require' > from /usr/share/foreman/config/application.rb:13:in `' > from > /opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:55:in > `require' > from > /opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:55:in > `require' > from > /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/commands.rb:53:in > `block in ' > from > /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/commands.rb:50:in > `tap' > from > /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/commands.rb:50:in > `' > from > /opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:60:in > `require' > from > /opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:60:in > `rescue in require' > from > /opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:35:in > `require' > from /usr/share/foreman/script/rails:6:in `' > [FAILED] > > I'm new to ruby but I'm absolutely sure that I messed up a bunch of gems > in learning how to get my plugin to work. Can anyone help? > > RHEL 6.5 > Foreman 1.7.4 >

These, and many more look very much incorrect. An RPM installation
should only ever have 3.2.8.

I guess you've run bundler manually somehow and it's downloaded and
installed local gems over your packaged installation. (It's best to do
plugin development on a proper source install, though that's not helpful
for me to say so right now.)

You might be able to remove bad versions individually with "gem
uninstall -v <version> <name>" until you get just the packaged versions
available again.

You could also try moving (deleting)
/opt/rh/ruby193/root/usr/local/share/gems/ (note the *local in the path,
that's non-packaged stuff) out as all of the non-packaged gems should
have been installed there.

··· On 13/04/15 18:41, Edson Manners wrote: > More useful stuff: > [root@foreman share]# scl enable ruby193 "gem list" > > *** LOCAL GEMS *** > > actionmailer (4.2.1, 3.2.21, 3.2.8) > actionpack (4.2.1, 3.2.21, 3.2.8) > actionview (4.2.1) > activejob (4.2.1) > activemodel (4.2.1, 3.2.21, 3.2.8)


Dominic Cleal
Red Hat Engineering

I'll give it a try. Thanks. Dominic. You guys do great work!

··· On Monday, April 20, 2015 at 7:23:17 AM UTC-4, Dominic Cleal wrote: > > On 13/04/15 18:41, Edson Manners wrote: > > More useful stuff: > > [root@foreman share]# scl enable ruby193 "gem list" > > > > *** LOCAL GEMS *** > > > > actionmailer (4.2.1, 3.2.21, 3.2.8) > > actionpack (4.2.1, 3.2.21, 3.2.8) > > actionview (4.2.1) > > activejob (4.2.1) > > activemodel (4.2.1, 3.2.21, 3.2.8) > > These, and many more look very much incorrect. An RPM installation > should only ever have 3.2.8. > > I guess you've run bundler manually somehow and it's downloaded and > installed local gems over your packaged installation. (It's best to do > plugin development on a proper source install, though that's not helpful > for me to say so right now.) > > You might be able to remove bad versions individually with "gem > uninstall -v " until you get just the packaged versions > available again. > > You could also try moving (deleting) > /opt/rh/ruby193/root/usr/local/share/gems/ (note the *local in the path, > that's non-packaged stuff) out as all of the non-packaged gems should > have been installed there. > > -- > Dominic Cleal > Red Hat Engineering >