App pushed to heroku still shows standard index page

前端 未结 2 343
死守一世寂寞
死守一世寂寞 2021-01-31 11:10

I went through the steps to install git and the heroku gem and successfully pushed my app to heroku. The problem is, it shows a standard \"You\'re Riding Ruby on Rails\" page ev

2条回答
  •  借酒劲吻你
    2021-01-31 11:33

    When you're using git and delete a file, that file is not automatically removed from the git repo. So when you git push heroku the file still exists and gets pushed to Heroku.

    You can tell if this is the case with git status, which will show something like:

    # Changes not staged for commit:
    #   (use "git add/rm ..." to update what will be committed)
    #   (use "git checkout -- ..." to discard changes in working directory)
    #
    #       deleted:    public/index.html
    

    In order to remove the file, you need to use git rm. In this case you need to do something like:

    git rm public/index.html
    git commit -m "Removed public/index.html"
    

    which will remove the file from the current branch.

    Now when you do

    git push heroku
    

    the file won't be included, and so you'll be routed to the controller as specified in routes.rb.

提交回复
热议问题