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.
Cygwinでは、パス内のスペースを円記号でエスケープする必要があります。Windowsでは当てはまりません。パス全体を引用符で囲んでください。
Rubyでこれに自動的に変換する方法はありますか?
それ以外の場合、RubyでWindowsまたはCygwinを実行しているかどうかをどのように検出しますか?
http://rant.rubyforge.org/
sys.escape("foo bar") # gives on Windows: '"foo bar"' # other systems: 'foo\ bar'
Cygwin でのパスの引用は正常に機能するはずです。
少なくともプラットフォームを検出する方法を見つけました - RUBY_PLATFORM 定数がそれを定義しています。