I was told that copying from
vendor/gems/somegem
from proj1 to proj2's folder will essentially freeze the gem into the project. The gem somegem
is an internal gem, so there is no repository to install it from. But I wonder how will it work w开发者_JAVA技巧ith Rails 3, since we need to use
gem 'somegem'
in the Gemfile, and supposedly when we do a gem list
, the name of the gem should show up. What is a good / proper way to do this? thanks.
I believe the Gemfile.lock
file stores the versions of the gems in use, along with any and all dependencies, so you can essentially copy over your Gemfile
and Gemfile.lock
and run bundle install
In your Gemfile you can tell bundler to get the gem from a local path:
gem 'somegem', :path => "some_path/to/somegem"
If your 'gem' is in fact a plugin then just copy the files to vendor/plugins
.
If install.rb in the plugin directory does anything special you may want to run this manually.
精彩评论