Gems don't need the Gemfile.lock
file, since their dependencies are declared in the gemspec
.
To add a dependency use add_runtime_dependency
:
spec.add_runtime_dependency 'example', '~> 1.1', '>= 1.1.4'
But this is not specific enough for deployment scenarios!
Well, true, but for a gem deployment means it is deployed into an application. The application should have the Gemfile.lock
file to pin down the specific library versions.
An application deployment needs to be fully replicable, so build numbers of all library versions should be meticulously maintained. Gems, on the other hand, strive to be compatible to as many versions as possible to be re-usable, otherwise, one gem update will break all the gems which depend on it.
As for the rest of your question (whether and how to split your app into gems) - I believe this is not the right forum for that, as it is too broad for SO, but I wish you luck on your endeavor for making your software more manageable and more re-usable!