ruby 没有这样的文件或目录 - getcwd
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21505878/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
No such file or directory - getcwd
提问by jason328
I uploaded my Sinatra app to Beanstalk. When I go to my site my logs are returned
我将我的 Sinatra 应用程序上传到 Beanstalk。当我访问我的网站时,我的日志会返回
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...
该应用程序之前可以运行。我相信这个问题与我将 SASS 添加到我的应用程序这一事实有关,但我并不乐观。在我的config.ru,我有以下处理 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.
如果这可能是另一个问题,请告诉我,我可以提供更多信息。谢谢。
采纳答案by jason328
Found out pg was installed instead of mysql2 in bundler.
发现在 bundler 中安装了 pg 而不是 mysql2。
回答by 6ft Dan
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.
我在切换数据库并让服务器运行后收到此错误。旧服务器信息仍在显示,但我收到此错误。重新启动了我的 rails 服务器,并且在新数据库上一切正常。
Basically it means that there is a significant state change on the server, and your environment needs to be reset/restarted.
基本上这意味着服务器上的状态发生了重大变化,您的环境需要重置/重新启动。
回答by Scott Rigby
The key for me was starting a new terminal session.
对我来说,关键是开始一个新的终端会话。
I just ran into this after trying vagrant upon 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 upran smoothly again.
vagrant up在同一个终端会话中尝试新创建的目录(删除同名目录后)后,我刚刚遇到了这个问题(奇怪的是,这是在与 Vagrant 合作多年后的第一次)。就我而言,我已经运行了vagrant destroy,因此不需要或可以重新启动有关环境的任何内容。我被阻止,直到我开始一个新的终端会话,然后vagrant up再次顺利运行。
回答by Jermaine Subia
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 restartto restart the server and when I went back to the website it was working again.
使用 Amazon EC2 和 rails 5 遇到了这个问题。我不得不删除我的目录并 git clone 它。我使用了 bundle install 和 rake db:migrate ,然后我遇到了同样的错误。我所要做的就是修复它sudo service nginx restart以重新启动服务器,当我回到网站时它又开始工作了。

