Ruby on rails: Basic hello world return method not allowed in Heroku production

Viewed 4511

I am really new in rails, I am currently doing the rails tutorial in Cloud9.

I did a simple endpoint to test my lovely Hello World in the default ApplicationController. This is my controller:

ApplicationController

class ApplicationController < ActionController::Base
  protect_from_forgery with: :exception
  def hello
    render html: "hello, world"
  end
end

It works perfectly fine: Hello world

But when I deploy the project in Heroku, it returns method not allowed.

Method not allowed

Any Idea what I am doing wrong? This are the other important files that I have

Gemfile

source 'https://rubygems.org'

gem 'rails',        '5.1.2'
gem 'puma',         '3.9.1'
gem 'sass-rails',   '5.0.6'
gem 'uglifier',     '3.2.0'
gem 'coffee-rails', '4.2.2'
gem 'jquery-rails', '4.3.1'
gem 'turbolinks',   '5.0.1'
gem 'jbuilder',     '2.7.0'

group :development, :test do
  gem 'sqlite3',      '1.3.13'
  gem 'byebug', '9.0.6', platform: :mri
end

group :development do
  gem 'web-console',           '3.5.1'
  gem 'listen',                '3.0.8'
  gem 'spring',                '2.0.2'
  gem 'spring-watcher-listen', '2.0.1'
end

group :production do
  gem 'pg', '0.20.0'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

Routes

Rails.application.routes.draw do
  # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
  root 'application#hello'
end

Also before I push to Heroku I did

> bundle update
> bundle install --without production
1 Answers
Related