27

I uploaded my Sinatra app to Beanstalk. When I go to my site my logs are returned

No such file or directory - getcwd

The app was working before. I believe the issue has to do with the fact that I added SASS to my app, but I'm not positive. In my config.ru, I have the following code dealing with SASS...

# use scss for stylesheets
Sass::Plugin.options[:style] = :compressed
use Sass::Plugin::Rack

If it could be another issue, let me know and I can provide more information. Thanks.

Zword
  • 6,605
  • 3
  • 27
  • 52
thank_you
  • 11,001
  • 19
  • 101
  • 185
  • 1
    Ugh. I solved it. Wasted 100 points for a problem I solved on my own. Looked like I had the wrong db gem installed in bundler. – thank_you Feb 04 '14 at 04:34
  • 2
    It is preferred that you provide an answer rather than editing the question to contain the solution. Otherwise it looks like your question is still unanswered. – cimmanon Feb 04 '14 at 18:33

4 Answers4

87

Some people received this error after trying to run from an already deleted directory.

I received this error after switching databases and leaving the server running. The old server info was still showing up but I was getting this error. Restarted my rails server and everything works fine with the new db.

Basically it means that there is a significant state change on the server, and your environment needs to be reset/restarted.

6ft Dan
  • 2,365
  • 1
  • 33
  • 46
  • I was repeatedly receiving an error that contained "No such file or directory - getcwd" using VS Code on Mac. I hit this solution from a Google search. The last line in this comment prompted me to restart VS Code. Turns out, it was the solution to my issue. – CitizenX Mar 05 '21 at 20:57
8

The key for me was starting a new terminal session.

I just ran into this after trying vagrant up on a newly created directory (after deleting one by the same name) in the same terminal session (oddly, for the first time after working with Vagrant for years). In my case I had already run vagrant destroy, so nothing about the environment needed to or could be be restarted. I was blocked until I started a new terminal session, then vagrant up ran smoothly again.

Scott Rigby
  • 634
  • 6
  • 6
2

Found out pg was installed instead of mysql2 in bundler.

thank_you
  • 11,001
  • 19
  • 101
  • 185
0

Ran across this issue with an Amazon EC2 and rails 5. I had to delete my directory and git clone it. I used bundle install and rake db:migrate and afterwards I ran into the same error. All I had to do to fix it was run sudo service nginx restart to restart the server and when I went back to the website it was working again.

Jermaine Subia
  • 776
  • 1
  • 7
  • 31