我推送代码后为什么要获得Heroku欢迎屏幕?

问题描述 投票:0回答:2

我正在使用Michael Hartl的book学习Ruby on Rails,我在尝试使用Heroku部署我的Hello World应用程序时遇到了第一章的问题。我一直得到默认的欢迎屏幕,即使我已经使用git将我的代码推送到Heroku,我的项目在localhost上工作正常。

我的路线文件设置如下:

Rails.application.routes.draw do
    root 'application#hello'
end

我的控制器是这样的:

class ApplicationController < ActionController::Base
    protect_from_forgery with: :exception

    def hello
        render html: "¡Hola, mundo!"
    end

end

我确保对git和我的目录进行任何更改,并在项目目录中创建了一个新的Heroku项目:

$ heroku login
$ heroku keys:add
$cd /mydirectory
$heroku create
$git push heroku master

git中的所有内容都是最新的,我不知道还有什么可以尝试。有任何想法吗?谢谢。

ruby-on-rails ruby git heroku web-deployment
2个回答
1
投票

请尝试以下命令:

  1. git add。
  2. git commit -m“fc”
  3. git push heroku master

0
投票

我发现我不小心将SQlite3留在了Heroku不支持的Gemfile中。

© www.soinside.com 2019 - 2024. All rights reserved.