我似乎與我的想法是捆綁的標準功能掙扎,根據the manual 到specifiy該寶石應該在需要使用:platforms
選項或platforms
塊與捆綁和不同平臺的寶石要求工作
我想specifcy一個不同版本的寶石依賴於紅寶石的版本中使用
source "http://rubygems.org"
gem "trollop", "~> 1.16.2"
gem "chronic", "~> 0.6.4"
gem "highline", "~> 1.6.2"
gem "colorize", "~> 0.5.8"
gem "queryparams", "~> 0.0.3"
platforms :ruby_18 do
gem "json"
gem "activesupport", "~>2.8.9"
end
platforms :ruby_19 do
gem "activesupport", "~>3.1.3"
end
但是失敗運行bundle install
You cannot specify the same gem twice with different version requirements.
You specified: activesupport (~> 2.8.9) and activesupport (~> 3.1.3)
你可以在Gemfile中平臺特定的要求,請查看我的回答 – klaffenboeck