How To Freeze Gems In Rails
Here’s how to freeze any gem into your Rails app. This is a simplified version of the larger discussion Vendor Everything at err.the_blog.
First, copy the gems you want into the directory vendor/gems.
Next, edit config/environment.rb and add the following inside the =Rails::Initializer.run= block:
Now you can require those gems in your code, even if the system you are running on doesn’t have that gem installed.