为什么我在推送代码后会看到 Heroku 欢迎屏幕?
Why am I getting the Heroku welcome screen after I push code?
我正在使用 Michael Hartl 的 book 在 Rails 上学习 Ruby 并且我 运行 在尝试使用 Heroku 部署我的时遇到了第一章中的问题你好世界应用程序。即使我使用 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 中的所有内容都是最新的,我不知道还能尝试什么。有任何想法吗?谢谢。
尝试以下命令:
- git 添加 .
- git commit -m "fc"
- git 推送 heroku 大师
我发现我不小心将 SQlite3 留在了 Heroku 不支持的 Gemfile 中。
我正在使用 Michael Hartl 的 book 在 Rails 上学习 Ruby 并且我 运行 在尝试使用 Heroku 部署我的时遇到了第一章中的问题你好世界应用程序。即使我使用 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 中的所有内容都是最新的,我不知道还能尝试什么。有任何想法吗?谢谢。
尝试以下命令:
- git 添加 .
- git commit -m "fc"
- git 推送 heroku 大师
我发现我不小心将 SQlite3 留在了 Heroku 不支持的 Gemfile 中。