Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"No such file or directory - getcwd" error on rubygems on Mac Os Lion

I'm trying to launch a heroku console that uses rubygems but I keep getting this error:

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:471:in `expand_path': No such file or directory - getcwd (Errno::ENOENT)     from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:471:in `find_files'     from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:470:in `map'     from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:470:in `find_files'     from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:1103     from /usr/bin/heroku:9:in `require'     from /usr/bin/heroku:9 

I'm using Mac OS Lion 10.7.3. Any ideas on how to fix this? Thanks!

like image 474
Michael Eilers Smith Avatar asked Feb 11 '12 19:02

Michael Eilers Smith


Video Answer


2 Answers

Maybe the current working directory of the shell that's used to start your heroku process doesn't exist (maybe removed by another process, as in my case), and therefore getcwd throws an error.

like image 168
gerardk Avatar answered Sep 20 '22 11:09

gerardk


This happened to me. It turned out I had deleted the folder I was running the command in.

like image 37
kilojoules Avatar answered Sep 18 '22 11:09

kilojoules