heroku 错误编号::错误:没有这样的文件或目录@ rb_sysopen - /tmp/

h7appiyu  于 2022-12-19  发布在  其他
关注(0)|答案(1)|浏览(85)

我试图将我的应用程序推送到Heroku,但我得到这个相当随意的错误:

Errno::ENOENT: No such file or directory @ rb_sysopen -\
       /tmp/build_.../config/aws.yml
       /tmp/build_.../vendor/bundle/ruby/2.1.0/gems/safe_yaml-1.0.3/lib/safe_yaml.rb:39:in `initialize'
       /tmp/build_.../vendor/bundle/ruby/2.1.0/gems/safe_yaml-1.0.3/lib/safe_yaml.rb:39:in `open'
       /tmp/build_.../vendor/bundle/ruby/2.1.0/gems/safe_yaml-1.0.3/lib/safe_yaml.rb:39:in `unsafe_load_file'
       /tmp/build_.../vendor/bundle/ruby/2.1.0/gems/safe_yaml-1.0.3/lib/safe_yaml.rb:24:in `load_file_with_options'
       /tmp/build_.../config/initializers/aws.rb:1:in `<top (required)>'
       /tmp/build_.../vendor/bundle/ruby/2.1.0/gems/activesupport-4.0.5/lib/active_support/dependencies.rb:223:in `load'
       /tmp/build_.../vendor/bundle/ruby/2.1.0/gems/activesupport-4.0.5/lib/active_support/dependencies.rb:223:in `block in load'
       /tmp/build_.../vendor/bundle/ruby/2.1.0/gems/activesupport-4.0.5/lib/active_support/dependencies.rb:214:in `load_dependency'
       /tmp/build_.../vendor/bundle/ruby/2.1.0/gems/activesupport-4.0.5/lib/active_support/dependencies.rb:223:in `load'
       /tmp/build_.../vendor/

我在aws.yml文件中有正确的键,所以我不知道为什么会出现这个错误,它在本地也工作正常。我试过删除/tmp文件夹并让Heroku重新生成它,但也不起作用。我该如何修复它?

jtjikinw

jtjikinw1#

您确定您的config/aws.yml位于正确的位置并且格式正确吗?请检查您的代码库中对它的所有引用。
当执行rake任务时,整个rails环境都会被加载,如果初始化器或rake任务调用的文件不存在或格式不正确,就会出现你提到的错误。

相关问题