[英]How to specify Gemfile so that it won't install a specific version of a gem
[英]How could I specify specific gem in Gemfile
我想在Gemfile中指定2个gem,
- activeadmin-dragonfly (0.0.2 89a47f9)
- activeadmin-wysihtml5 (1.0.0 35d1a94)
我该怎么办?
这是我的主意
gem 'activeadmin-dragonfly', github: 'stefanoverna/activeadmin-dragonfly' '~> 0.0.2 89a47f9'
您可以通过添加以下命令从github指定一个gem的版本:
gem 'gem_name', github: 'author/repository_name', ref: 'ref', tag: 'tag'
在您的情况下:
gem 'activeadmin-dragonfly', github: 'stefanoverna/activeadmin-dragonfly', ref: '89a47f9'
希望你还好...我刚刚读了你的问题,这对我来说是有帮助的...
source 'https://rubygems.org' # SSL Connection for downloading gems
# This is the start of the gem lists
gem 'gem-file-name' , 'specific gem version'
gem 'gem-file-name' , '=> gem-version'
gem 'gem-file-name' , '~> gem-version'
您只能使用第一个获得特定的gem,最后一个也可以获取beta版本……或者,如果您想使用git repo拥有它,则可以...
gem 'Gem Name', :git => 'https://github.com/Username/filename.git'
或者从Git Repo获取多个宝石
git 'https://github.com/rails/rails.git' do
gem 'railties'
gem 'action_pack'
gem 'active_model'
end
有关更多数据,请访问http://bundler.io/v1.9/git.html
希望这能解决您的问题...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.