Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Bundler と Gemfile の両方の存在を確認するにはどうすればよいですか?
私の最初の推測ではdefined?(Bundler) && File.exist?('Gemfile').
defined?(Bundler) && File.exist?('Gemfile')
これ:
Bundler::SharedHelpers.in_bundle?
ENVbundler が読み込まれると、キーを使用してグローバルから Gemfile パスを取得できます'BUNDLE_GEMFILE'。
ENV
'BUNDLE_GEMFILE'