how to get the current working directory’s absolute path from irb

I’m running Ruby on Windows though I don’t know if that should make a difference. All I want to do is get the current working directory’s absolute path. Is this possible from irb? Apparently from a script it’s possible using File.expand_path(__FILE__)

But from irb I tried the following and got a “Permission denied” error:

File.new(Dir.new(".").path).expand

6 Answers
6

Leave a Comment