【问题标题】:Heroku can't see config folder; why?Heroku 看不到配置文件夹;为什么?
【发布时间】:2012-05-13 14:26:24
【问题描述】:

虽然 config 文件夹已提交,但 heroku 并没有看到它.. 当我做heroku run rake db:migrate 时,我得到了这个错误:

Running rake db:migrate attached to terminal... up, run.1
rake aborted!
no such file to load -- /app/config/application

我试着这样测试它:

$ heroku run bash -a myapp
~ $ ls config
ls: cannot access config: No such file or directory 

虽然我确定配置文件夹已提交并推送,但有人可以帮助我吗?

这里是 git 状态:

# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#   new file:   .gitignore~
#   modified:   .idea/workspace.xml
#
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#   modified:   .idea/workspace.xml

【问题讨论】:

    标签: ruby-on-rails-3 git bash heroku


    【解决方案1】:

    您确定不是它找不到的application.rb 文件吗?你可以试试:

    $ heroku run bash -a myapp
    ~ $ ls -al /app/config
    

    【讨论】:

    • 是的,这是我得到的:ls: 无法访问 /app/config: 没有这样的文件或目录
    • 您的 rake 输出表明它正在尝试从 /app/config 文件夹中加载 application.rb,而在 Rails 中它应该位于应用程序目录的同一级别,即 /config/application.rb - 确实应用在本地启动?
    【解决方案2】:

    强制另一个 git push 到您的远程 heroku 存储库。今天在 Heroku 上出现了一些 git push 错误。见http://status.heroku.com

    【讨论】:

    • 我试图像这样强制推送:git push heroku master -f,但是,我得到一个结果:一切都是最新的,这是强制 git push 的正确方法吗?
    • 对某个文件进行更改,进行本地提交,然后再次推送到 Heroku。
    • 我尝试对 boot.rb 和 application.rb 进行更改,提交,并再次推送,但是,我有同样的错误..
    猜你喜欢
    • 1970-01-01
    • 2012-07-30
    • 2015-03-31
    • 2021-08-12
    • 1970-01-01
    • 2016-01-10
    • 1970-01-01
    • 2015-06-06
    • 2011-01-31
    相关资源
    最近更新 更多