简体   繁体   English

Heroku Rails设置“您正在寻找的页面不存在。”

[英]Heroku Rails Setup “The page you were looking for doesn't exist.”

I'm following this Rails tutorial . 我正在关注这个Rails教程 When I run rails server locally, I can see the "Welcome Aboard" page. 当我在本地运行rails服务器时,我可以看到“Welcome Aboard”页面。 However, when deploying to Heroku, it shows "The page you were looking for doesn't exist." 但是,在部署到Heroku时,它会显示“您正在查找的页面不存在”。 I've searched around but couldn't find anything to solve my problem. 我已经四处寻找,但找不到任何可以解决我问题的方法。 Below are my steps: 以下是我的步骤:

rails new first_app  

Make this change to Gemfile: 对Gemfile进行此更改:

group :production do
    gem 'pg'
end

group :development do 
    gem 'sqlite3' 
end

Then, 然后,

bundle update
bundle install
bundle install --without production
rake assets:precompile

git init
git add .
git commit -m "initial commit"

heroku login
heroku create
git push heroku master
heroku open

At this point it opens the address for the heroku app and gives the "doesn't exist" error. 此时,它会打开heroku应用程序的地址,并显示“不存在”错误。 When checking 'heroku logs' it shows the status=404 of my visit: 检查'heroku logs'时,它显示我访问的状态= 404: heroku日志

Beginning in Rails 4, the "Welcome Aboard" page is no longer a static page located in the public directory, it is a smoke page located within the Rails framework itself. 从Rails 4开始,“Welcome Aboard”页面不再是位于public目录中的静态页面,它是位于Rails框架内部的烟雾页面。 This page will only be shown in the development mode, so when you've deployed to Heroku and are running in production mode, you won't get an automatic start page. 此页面仅在开发模式下显示,因此当您部署到Heroku并在production模式下运行时,您将无法获得自动启动页面。 You'll need to add a root route otherwise you'll get the error you are seeing. 您需要添加root路由,否则您将收到您看到的错误。

see: Where is the default "Welcome Aboard" page located in my app? 请参阅: 我的应用程序中默认的“欢迎登机”页面在哪里?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 rails heroku错误:未定义路线,但路线存在(您要查找的页面不存在。) - rails heroku error: no route defined, but route is there (The page you were looking for doesn't exist.) Rails / Heroku您正在寻找的页面不存在 - Rails/Heroku The page you were looking for doesn't exist Ruby on Rails / Heroku-您要查找的页面不存在 - Ruby on Rails / Heroku - The page you were looking for doesn't exist 您要查找的页面不存在 - heroku + rails - The page you were looking for doesn't exist - heroku+rails 无法在heroku上部署应用程序,总是得到“您要查找的页面不存在。”错误 - Can't deploy app on heroku, always get “The page you were looking for doesn't exist.” error 在商店上安装后的Heroku Shopify应用程序“您要查找的页面不存在。” - Heroku Shopify App after installation on shop “The page you were looking for doesn't exist.” heroku“您要查找的页面不存在。”遵循Hartl的RoR指南 - heroku “The page you were looking for doesn't exist.” following Hartl's RoR guide Cloud9,GitHub和Heroku(您要查找的页面不存在。) - Cloud9, GitHub and Heroku (The page you were looking for doesn't exist.) “您要查找的页面不存在。”编辑表单 - “The page you were looking for doesn't exist.” edit form 为什么当我在Heroku的另一个窗口中打开新链接时显示“您要查找的页面不存在”的原因。 - Why is it when I open a new link in another window on Heroku it says “The page you were looking for doesn't exist.”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM