【发布时间】:2016-05-11 14:31:38
【问题描述】:
我刚刚开始学习 M. Hartl 编写的 Ruby on Rails 教程。 .我遵循了从 2.1 到 2.1.1 的每一步。 所以我创建了应用程序并将我所做的所有更改推送到 Heroku
用 $ heroku 创建 和 $ git push heroku master
没有得到任何错误或任何东西。 但是当我尝试通过单击地址 (https://pacific-woodland-39108.herokuapp.com) 查看应用程序时,我只能看到“您要查找的页面不存在。”。所以出了点问题,但我找不到什么。在过去的 3 个小时里,我一直在研究类似的问题,并尝试了许多“解决方案”,但没有任何效果。我什至删除了该应用程序,并再次执行了教程所述的每一步。但这没有帮助。
有人可以帮我吗?
编辑:
我显然玩过很多“heroku create”命令,现在我有几个应用程序。也许我应该删除所有这些(如何?)并从头开始?
路线调整(去掉'#'以便激活)
commands i used that were mentioned in one of the answers. Still doesn't work though :/
source 'https://rubygems.org'
source 'https://rubygems.org'
GEMFILE:
gem 'rails', '4.2.2'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'sqlite3', '1.3.9'
end
group :production do
gem 'pg', '0.17.1'
gem 'rails_12factor', '0.0.2'
end
ROUTE 文件:
Rails.application.routes.draw do
# The priority is based upon order of creation: first created -> highest priority.
# See how all your routes lay out with "rake routes".
# You can have the root of your site routed with "root"
root 'welcome#index'
【问题讨论】:
-
除了默认生成的应用之外,你有没有添加任何路由/控制器/视图?
-
如果您运行
heroku logs,您会看到 500 错误吗? -
我在教程中遇到了很多问题,但始终是我自己的错误。该教程有效。从头开始该部分。
-
请包含您的路由文件和 gemfile。
标签: ruby-on-rails ruby git heroku railstutorial.org