gpt4 book ai didi

ruby-on-rails - 无法显示 heroku 应用程序 -Ruby on Rails 教程 -M Hartl

转载 作者:太空宇宙 更新时间:2023-11-03 16:59:03 25 4
gpt4 key购买 nike

我刚刚开始学习 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'

gem 文件:

  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

路线文件:

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'

最佳答案

需要仔细检查的事情:

  • 确保您在routes.rb 文件中设置了root
  • 不要忘记使用 heroku run rake db:migrate 进行迁移

关于ruby-on-rails - 无法显示 heroku 应用程序 -Ruby on Rails 教程 -M Hartl,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37165770/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com