I tried adding a few gems to my Rails app using the config.gem instruction in environment.rb so that when the app gets deployed on a new system, the missing gems issue can be taken care of with rake gems:install
After adding the list of required gems that my app depends on, my app failed to start. If I remove the list of required gems from the environment.rb file the app starts fine.
The comment in environment.rb says
# You have to specify the :lib option for libraries, where the Gem name (sqlite3-ruby) differs from the file itself (sqlite3)
I am pretty much certain that I am missing the :lib option for one of the gems, how does one find if the gem is a library and the library name for it?
My tried and true method of finding the correct library (if not included in the readme, which I’ve found to often been the case) is to run
gem spec
and then looking through the file list, especially in the lib/ directory. Usually the one with the name closest to the gem itself is the one I’m looking for. Obviously this is not %100 reliable, but its worked for me alright.
For example gem spec ruby-plsql gives
And I see
lib/ruby_plsql.rb
and since the gem is named ruby-plsql, I’m gonna take a guess that it might be the main lib file. You can also check the .gemspec file to see what it is building to.