Answering the second part of your question, developing a plugin/gem and shipping it with the rails app without making the gem publicly available, you may do this
Gemfile
gem 'my_private_gem', :path => "vendor/gems/my_private_gem-VERSION"
assuming you performed a gem unpack my_private_gem --target vendor/gems
note: bundle package unpacks all gems (as many as in Gemfile.lock). I wouldn’t want those in git.