我正在尝试将我的应用程序推送到 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 重新生成它,这也不起作用。我该如何解决?
最佳答案
你确定你的 config/aws.yml
是否在正确的位置并正确形成?请检查您的代码库中对它的所有引用。
当执行 rake 任务时,整个 rails 环境都会被加载。如果初始化程序或 rake 任务调用的任何文件不存在或格式不正确,则会出现您提到的错误。
关于ruby-on-rails - Errno::ENOENT: 没有这样的文件或目录@rb_sysopen -/tmp/,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23765318/