应用推送到英雄仍然显示标准索引页 [英] App pushed to heroku still shows standard index page

查看:95
本文介绍了应用推送到英雄仍然显示标准索引页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我经历了安装git和英雄宝石的步骤,并成功地将我的应用推送到了heroku。
问题是,它显示了一个标准的你骑着Ruby on Rails页面,即使本地应用程序已经将路由设置为root到某个控制器/页面。我也从/ public中删除了index.html页面。

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 even though the local app I have has routes set up to root to a certain controller/page. I have also deleted the index.html page from /public.

任何想法为什么会发生这种情况?我怀疑我可能需要从开发转向部署,但仍然,我删除了index.html,为什么它仍然显示在heroku?

Any idea why this is happening? I suspect I might needed to switch from development to deployment somehow but still, I deleted the index.html, why is it still showing up on heroku?

编辑:转到mysite.heroku / login和其他页面,我创建的工作正常,因为某些原因,所以永远不会在部署的东西。

Going to mysite.heroku/login and other pages I've created works fine for some reason, so nevermind on the deployment thing.

推荐答案

当您使用git并删除文件时,该文件不会自动从git repo中删除。所以当你 git push heroku 该文件仍然存在并被推送到Heroku。

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.

你可以知道这是否是 git status 的情况,将显示如下:

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 <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#       deleted:    public/index.html

为了删除该文件,您需要使用 git rm 。在这种情况下,您需要执行以下操作:

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.

现在当你做

git push heroku

该文件将不被包含,因此您将被路由到routes.rb中指定的控制器。

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

这篇关于应用推送到英雄仍然显示标准索引页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆