背景 dep_selector gem包含本机Ruby绑定,用于使用Gecode解决依赖关系图。 它接受包及其依赖关系的表示,并找到包与满足所需约束的版本的绑定。 安装 从Rubygems安装gem: gem install dep_selector 或将其添加到您的Gemfile : gem 'dep_selector' 通过例子学习 require 'dep_selector' # This example corresponds to the following dependency graph: # A has versions: 1, 2 # B has versions: 1, 2, 3 # C has versions: 1, 2 # D has versions: 1, 2 # A1 -> B=1 (v1 of package A d