Ruby 2.6.0 リファレンスマニュアル > ライブラリ一覧 > rubygems/dependency_listライブラリ > Gem::DependencyListクラス > dependency_order

instance method Gem::DependencyList#dependency_order

dependency_order -> [Gem::Specification][permalink][rdoc]

依存する Gem の数が少ない順にソートされた Gem::Specification のリストを返します。

このことは、インストール済みの Gem を削除するときに便利です。このメソッドで返された順にインストール済みの Gem 削除すると、依存関係による多くの問題を回避することができます。

If there are circular dependencies (yuck!), then gems will be returned in order until only the circular dependents and anything they reference are left. Then arbitrary gemspecs will be returned until the circular dependency is broken, after which gems will be returned in dependency order again.