Debugging Ruby initializer

Since you want to debug some code, the simplest way would be to launch the Rails console for the app you are adding the initializer to. For example on one of the test vms that we have OnDemand running I can do this:

$ scl enable ondemand -- bash
$ cd /var/www/ood/apps/sys/dashboard
$ RAILS_ENV=production bin/rails c
Rails Error: Unable to access log file. Please ensure that /var/www/ood/apps/sys/dashboard/log/production.log exists and is writable (ie, make it writable for user and group: chmod 0664 /var/www/ood/apps/sys/dashboard/log/production.log). The log level has been raised to WARN and the output directed to STDERR until the problem is fixed.
Loading production environment (Rails 5.2.4.2)
=> Unable to load pry
irb(main):001:0> OodSupport
=> OodSupport
irb(main):002:0>

There you have a Ruby interpreter you can test out commands line by line, that includes all the libraries that should be available to the initializer.