git push heroku
一切都很好,然后 heroku open
- 但它只显示 Rails 登陆页面。当我尝试使用rails s 时,我的主页已完美加载。我删除了 public/index.html 并将更改提交/推送到 github。可能是什么原因造成的?
路线.rb:
Oxenblog::Application.routes.draw do
root :to => 'static_pages#about'
match '/about', to: 'static_pages#about'
match '/contact', to: 'static_pages#contact'
match '/projects', to: 'static_pages#projects'
我认为这是我用 Heroku 做的事情的问题,因为它在 localhost 中看起来很好......
这是 git 分支的东西。我已添加 commited 并推送到 github 和 heroku ,并且 一切都是最新的
。然而,heroku open
仍然显示 Rails 登陆页面,非常令人沮丧。我在 master 分支上,这是一个新项目,所以我还没有创建任何新分支。
最佳答案
仅删除默认的 Rails 主页是不够的,您必须指示 git 删除所有已删除的文件。这是我使用的命令:
git add .
git commit -am "save all changed files & remove deleted ones"
git push heroku master
其他应该有效的命令:
git add . -A
git commit -m "..."
git add -u
git commit -m "..."
请注意,如果您在执行任何提交之前删除文件,那么 git 无法添加它们。
关于ruby-on-rails - 我 git Push 后,heroku 没有更新,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16026209/