Newbie to both Rails and Heroku, and I'm trying to deploy a simple app by following the step-by-step instructions in the Rails Tutorial. The app runs fine locally and shows the default Rails starter page. But navigating to the app url in Heroku keeps giving me a 404 Page Not Found, even though it's the same app and I haven't touched the routes files or any controllers etc.
I'm on a Mac 10.6.8 with the latest Ruby (1.9.3) and Rails (4.0.0).
Things I've Tried:
Following the answer in Rails 3.1.3 on Heroku: (No route matches [GET] "/assets/rails.png") I added code to config/application.rb for lazily compiling assets in production:
if defined?(Bundler)
# If you want your assets lazily compiled in production, use this line
Bundler.require(:default, :assets, Rails.env)
end
Following the answer in Rails production static files routing error I modified production.rb to ensure static assets were being served:
config.serve_static_assets = true
But I still get the 404. What else can I try?
Heroku Log:
2013-05-31T16:39:41.675219+00:00 app[web.1]: ActionController::RoutingError (No route matches [GET] "/"):
2013-05-31T16:39:41.675219+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-4.0.0.rc1/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
2013-05-31T16:39:41.675513+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-4.0.0.rc1/lib/rails/rack/logger.rb:21:in `call'
2013-05-31T16:39:41.675219+00:00 app[web.1]: F, [2013-05-31T16:32:49.152450 #2] FATAL -- :
2013-05-31T16:39:41.675513+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-4.0.0.rc1/lib/action_dispatch/middleware/request_id.rb:21:in `call'
2013-05-31T16:39:41.675513+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
2013-05-31T16:39:41.675513+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-4.0.0.rc1/lib/active_support/tagged_logging.rb:67:in `block in tagged'
2013-05-31T16:39:41.676016+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-4.0.0.rc1/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
2013-05-31T16:39:41.675513+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-4.0.0.rc1/lib/active_support/tagged_logging.rb:25:in `tagged'
2013-05-31T16:39:41.675513+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-4.0.0.rc1/lib/action_dispatch/middleware/static.rb:64:in `call'
2013-05-31T16:39:41.675777+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
2013-05-31T16:39:41.675513+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-4.0.0.rc1/lib/active_support/tagged_logging.rb:67:in `tagged'
2013-05-31T16:39:41.675777+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
2013-05-31T16:39:41.676016+00:00 app[web.1]: F, [2013-05-31T16:32:52.415675 #2] FATAL -- :
2013-05-31T16:39:41.675513+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/runtime.rb:17:in `call'
2013-05-31T16:39:41.675777+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
2013-05-31T16:39:41.675777+00:00 app[web.1]:
2013-05-31T16:39:41.675777+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-4.0.0.rc1/lib/rails/engine.rb:511:in `call'
2013-05-31T16:39:41.675777+00:00 app[web.1]:
2013-05-31T16:39:41.676016+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-4.0.0.rc1/lib/active_support/tagged_logging.rb:67:in `block in tagged'
2013-05-31T16:39:41.675777+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-4.0.0.rc1/lib/rails/application.rb:96:in `call'
2013-05-31T16:39:41.675777+00:00 app[web.1]: vendor/ruby-1.9.3/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
2013-05-31T16:39:41.675777+00:00 app[web.1]: vendor/ruby-1.9.3/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
2013-05-31T16:39:41.676016+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-4.0.0.rc1/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
2013-05-31T16:39:41.675513+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-4.0.0.rc1/lib/active_support/cache/strategy/local_cache.rb:83:in `call'
2013-05-31T16:39:41.676016+00:00 app[web.1]: I, [2013-05-31T16:32:52.414612 #2] INFO -- : Started GET "/" for 67.244.94.162 at 2013-05-31 16:32:52 +0000
2013-05-31T16:39:41.676016+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-4.0.0.rc1/lib/rails/rack/logger.rb:21:in `block in call'
2013-05-31T16:39:41.676016+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-4.0.0.rc1/lib/rails/rack/logger.rb:38:in `call_app'
2013-05-31T16:39:41.676253+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-4.0.0.rc1/lib/action_dispatch/middleware/static.rb:64:in `call'
2013-05-31T16:39:41.676016+00:00 app[web.1]: ActionController::RoutingError (No route matches [GET] "/"):
2013-05-31T16:39:41.676016+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-4.0.0.rc1/lib/active_support/tagged_logging.rb:25:in `tagged'
2013-05-31T16:39:41.676253+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
2013-05-31T16:39:41.676253+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-4.0.0.rc1/lib/action_dispatch/middleware/request_id.rb:21:in `call'
2013-05-31T16:39:41.675777+00:00 app[web.1]: vendor/ruby-1.9.3/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'
2013-05-31T16:39:41.676016+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-4.0.0.rc1/lib/active_support/tagged_logging.rb:67:in `tagged'
2013-05-31T16:39:41.676253+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-4.0.0.rc1/lib/rails/application.rb:96:in `call'
2013-05-31T16:39:41.676490+00:00 app[web.1]:
2013-05-31T16:39:41.676253+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-4.0.0.rc1/lib/active_support/cache/strategy/local_cache.rb:83:in `call'
2013-05-31T16:39:41.676490+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
2013-05-31T16:39:41.676490+00:00 app[web.1]:
2013-05-31T16:39:41.676253+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
2013-05-31T16:39:41.676253+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
2013-05-31T16:39:41.676490+00:00 app[web.1]: vendor/ruby-1.9.3/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
2013-05-31T16:39:41.676253+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/runtime.rb:17:in `call'
2013-05-31T16:39:41.676253+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-4.0.0.rc1/lib/rails/engine.rb:511:in `call'
2013-05-31T16:39:41.676490+00:00 app[web.1]: vendor/ruby-1.9.3/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'
2013-05-31T16:39:41.676490+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-4.0.0.rc1/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
2013-05-31T16:39:41.676253+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-4.0.0.rc1/lib/rails/rack/logger.rb:21:in `call'
2013-05-31T16:39:41.676490+00:00 app[web.1]: I, [2013-05-31T16:38:42.543864 #2] INFO -- : Started GET "/" for 67.244.94.162 at 2013-05-31 16:38:42 +0000
2013-05-31T16:39:41.676725+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-4.0.0.rc1/lib/rails/rack/logger.rb:21:in `call'
2013-05-31T16:39:41.676725+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/runtime.rb:17:in `call'
2013-05-31T16:39:41.676725+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-4.0.0.rc1/lib/active_support/tagged_logging.rb:67:in `tagged'
2013-05-31T16:39:41.676725+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-4.0.0.rc1/lib/rails/rack/logger.rb:38:in `call_app'
2013-05-31T16:39:41.676490+00:00 app[web.1]: ActionController::RoutingError (No route matches [GET] "/"):
2013-05-31T16:39:41.676725+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-4.0.0.rc1/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
2013-05-31T16:39:41.676725+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-4.0.0.rc1/lib/active_support/tagged_logging.rb:67:in `block in tagged'
2013-05-31T16:39:41.676725+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-4.0.0.rc1/lib/active_support/tagged_logging.rb:25:in `tagged'
2013-05-31T16:39:41.676725+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
2013-05-31T16:39:41.676490+00:00 app[web.1]: vendor/ruby-1.9.3/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
2013-05-31T16:39:41.676490+00:00 app[web.1]: F, [2013-05-31T16:38:42.544833 #2] FATAL -- :
2013-05-31T16:39:41.677196+00:00 app[web.1]:
2013-05-31T16:39:41.677196+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-4.0.0.rc1/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
2013-05-31T16:39:41.676961+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-4.0.0.rc1/lib/active_support/cache/strategy/local_cache.rb:83:in `call'
2013-05-31T16:39:41.676961+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
2013-05-31T16:39:41.676961+00:00 app[web.1]: vendor/ruby-1.9.3/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
2013-05-31T16:39:41.676961+00:00 app[web.1]: vendor/ruby-1.9.3/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
2013-05-31T16:39:41.677196+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-4.0.0.rc1/lib/active_support/tagged_logging.rb:67:in `block in tagged'
2013-05-31T16:39:41.677432+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-4.0.0.rc1/lib/action_dispatch/middleware/request_id.rb:21:in `call'
2013-05-31T16:39:41.677196+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-4.0.0.rc1/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
2013-05-31T16:39:41.677665+00:00 app[web.1]: vendor/ruby-1.9.3/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
2013-05-31T16:39:41.676961+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-4.0.0.rc1/lib/action_dispatch/middleware/static.rb:64:in `call'
2013-05-31T16:39:41.677196+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-4.0.0.rc1/lib/rails/rack/logger.rb:38:in `call_app'
2013-05-31T16:39:41.677432+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
2013-05-31T16:39:41.676961+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-4.0.0.rc1/lib/rails/engine.rb:511:in `call'
2013-05-31T16:39:41.676961+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
2013-05-31T16:39:41.677196+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-4.0.0.rc1/lib/rails/rack/logger.rb:21:in `block in call'
2013-05-31T16:39:41.677432+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-4.0.0.rc1/lib/rails/rack/logger.rb:21:in `call'
2013-05-31T16:39:41.677432+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-4.0.0.rc1/lib/rails/engine.rb:511:in `call'
2013-05-31T16:39:41.677665+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
2013-05-31T16:39:41.676725+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-4.0.0.rc1/lib/rails/rack/logger.rb:21:in `block in call'
2013-05-31T16:39:41.676725+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-4.0.0.rc1/lib/action_dispatch/middleware/request_id.rb:21:in `call'
2013-05-31T16:39:41.676961+00:00 app[web.1]: vendor/ruby-1.9.3/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'
2013-05-31T16:39:41.677196+00:00 app[web.1]:
2013-05-31T16:39:41.677196+00:00 app[web.1]: I, [2013-05-31T16:39:41.674148 #2] INFO -- : Started GET "/" for 67.244.94.162 at 2013-05-31 16:39:41 +0000
2013-05-31T16:39:41.676969+00:00 heroku[router]: at=info method=GET path=/ host=floating-refuge-5703.herokuapp.com fwd="67.244.94.162" dyno=web.1 connect=0ms service=5ms status=404 bytes=1351
2013-05-31T16:39:41.676961+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-4.0.0.rc1/lib/rails/application.rb:96:in `call'
2013-05-31T16:39:41.676961+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
2013-05-31T16:39:41.677196+00:00 app[web.1]: ActionController::RoutingError (No route matches [GET] "/"):
2013-05-31T16:39:41.677432+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/runtime.rb:17:in `call'
2013-05-31T16:39:41.677665+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
2013-05-31T16:39:41.677432+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-4.0.0.rc1/lib/active_support/tagged_logging.rb:67:in `tagged'
2013-05-31T16:39:41.677665+00:00 app[web.1]:
2013-05-31T16:39:41.677432+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-4.0.0.rc1/lib/action_dispatch/middleware/static.rb:64:in `call'
2013-05-31T16:39:41.677665+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
2013-05-31T16:39:41.677432+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-4.0.0.rc1/lib/active_support/cache/strategy/local_cache.rb:83:in `call'
2013-05-31T16:39:41.677665+00:00 app[web.1]: vendor/ruby-1.9.3/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
2013-05-31T16:39:41.677665+00:00 app[web.1]:
2013-05-31T16:39:41.677196+00:00 app[web.1]: F, [2013-05-31T16:39:41.675079 #2] FATAL -- :
2013-05-31T16:39:41.677432+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-4.0.0.rc1/lib/active_support/tagged_logging.rb:25:in `tagged'
2013-05-31T16:39:41.677432+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-4.0.0.rc1/lib/rails/application.rb:96:in `call'
2013-05-31T16:39:41.677665+00:00 app[web.1]: vendor/ruby-1.9.3/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'
First of all Rails4 apps no longer serve public/index.html, or app/assets/rails.png, as those files are now handled by the rails gem itself, so you can safely ignore all talk relating to them.
Secondly, I would advise you to ignore the advice given in the question you linked to as it's not at all relevant for rails4. You will not need to procompile your assets if you're using heroku. They do it for you when you push your app to them. It's probably worth removing the public/assets folder that you created when your ran rake assets:precompile as it will just get in the way
Thirdly, remove the code you added to config/application.rb as there is no assets group in Rails 4
Fourthly, heroku used to inject a plugin for serving static assets into your app, but now you need to do that yourself by adding the following to your Gemfile:
gem 'rails_log_stdout', github: 'heroku/rails_log_stdout'
gem 'rails3_serve_static_assets', github: 'heroku/rails3_serve_static_assets'
Fifthly, you are using Webrick server. Heroku advise you to switch to Unicorn.
Lastly, don't worry about the default Rails landing page not being shown on Heroku. It might be a bug in their system, it happened to me, it will happen to the next guy, it would more than likely happen to Matz if he tried it too. It's no big deal. Just move on. Your app is ready for you to start developing your own landing page.
Good luck and for what it's worth, here's a very simple example Gemfile optimised for heroku:
source 'https://rubygems.org'
# you are using Ruby 1.9.3, better to 2.0.0 upgrade for more speed
ruby '2.0.0'
gem 'rails', '4.0.0.rc1'
gem 'sass-rails', '~> 4.0.0.rc1'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 1.0.1'
# The asset_sync gem is WELL worth using
# but you should read more about it before deciding
# https://github.com/rumblelabs/asset_sync
# gem 'asset_sync'
# only want sqlite in dev and test envs
group :development, :test do
gem 'sqlite3'
end
group :production do
gem 'pg' # dont want sqlite in production
gem 'unicorn' # make sure you follow installation instructions for this gem
gem 'rails_log_stdout', github: 'heroku/rails_log_stdout'
gem 'rails3_serve_static_assets', github: 'heroku/rails3_serve_static_assets'
end
group :doc do
gem 'sdoc', require: false
end
Related
I have a utility on ruby on rails that uploads files to public folder. And by providing the link to that file i can download that file.
It is working fine on local rails server.
I deployed my work to heroku. where uploading part works. but when i click to login button it simply gives error
The page you were looking for doesn't exist.
You may have mistyped the address or the page may have moved.
on looking to heroku logs, i noticed it is a routing error.
Any one please let me know what i am missing. as i am really beginner with heroku.
Thanks regards,
Update
Here are the heroku logs
2014-08-12T12:44:02.705737+00:00 app[web.1]: Rendered internships/show.html.erb within layouts/application (23.2ms)
2014-08-12T12:44:14.260997+00:00 heroku[router]: at=info method=GET path="/resume/Saghir%20Resume1.docx" host=shielded-atoll-2450.herokuapp.com request_id=87d911ee-2bb3-40e7-923b-a8029f7ab6ff fwd="39.44.84.14" dyno=web.1 connect=2ms service=27ms status=404 bytes=1182
2014-08-12T12:44:14.253695+00:00 app[web.1]: Started GET "/resume/Saghir%20Resume1.docx" for 39.44.84.14 at 2014-08-12 12:44:14 +0000
2014-08-12T12:44:14.256004+00:00 app[web.1]:
2014-08-12T12:44:14.253706+00:00 app[web.1]: Started GET "/resume/Saghir%20Resume1.docx" for 39.44.84.14 at 2014-08-12 12:44:14 +0000
2014-08-12T12:44:14.256011+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.5/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
2014-08-12T12:44:14.256016+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.5/lib/active_support/tagged_logging.rb:68:in `block in tagged'
2014-08-12T12:44:14.256007+00:00 app[web.1]: ActionController::RoutingError (No route matches [GET] "/resume/Saghir%20Resume1.docx"):
2014-08-12T12:44:14.256009+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.5/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
2014-08-12T12:44:14.256014+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.5/lib/rails/rack/logger.rb:20:in `block in call'
2014-08-12T12:44:14.256017+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.5/lib/active_support/tagged_logging.rb:26:in `tagged'
2014-08-12T12:44:14.256012+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.5/lib/rails/rack/logger.rb:38:in `call_app'
2014-08-12T12:44:14.256056+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
2014-08-12T12:44:14.256059+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
2014-08-12T12:44:14.256054+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.5/lib/rails/application.rb:97:in `call'
2014-08-12T12:44:14.256022+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.5/lib/action_dispatch/middleware/request_id.rb:21:in `call'
2014-08-12T12:44:14.256063+00:00 app[web.1]: vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
2014-08-12T12:44:14.256019+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.5/lib/active_support/tagged_logging.rb:68:in `tagged'
2014-08-12T12:44:14.256020+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.5/lib/rails/rack/logger.rb:20:in `call'
2014-08-12T12:44:14.256064+00:00 app[web.1]:
2014-08-12T12:44:14.256060+00:00 app[web.1]: vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
2014-08-12T12:44:14.256078+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.5/lib/rails/rack/logger.rb:20:in `block in call'
2014-08-12T12:44:14.256066+00:00 app[web.1]:
2014-08-12T12:44:14.256057+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
2014-08-12T12:44:14.256094+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.5/lib/rails/engine.rb:511:in `call'
2014-08-12T12:44:14.256023+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
2014-08-12T12:44:14.256077+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.5/lib/rails/rack/logger.rb:38:in `call_app'
2014-08-12T12:44:14.256072+00:00 app[web.1]: ActionController::RoutingError (No route matches [GET] "/resume/Saghir%20Resume1.docx"):
2014-08-12T12:44:14.256074+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.5/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
2014-08-12T12:44:14.256090+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.5/lib/active_support/cache/strategy/local_cache.rb:83:in `call'
2014-08-12T12:44:14.256080+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.5/lib/active_support/tagged_logging.rb:68:in `block in tagged'
2014-08-12T12:44:14.256098+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
2014-08-12T12:44:14.256091+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.5/lib/action_dispatch/middleware/static.rb:64:in `call'
2014-08-12T12:44:14.256025+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/runtime.rb:17:in `call'
2014-08-12T12:44:14.256104+00:00 app[web.1]: vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
2014-08-12T12:44:14.256027+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.5/lib/active_support/cache/strategy/local_cache.rb:83:in `call'
2014-08-12T12:44:14.256097+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
2014-08-12T12:44:14.256085+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.5/lib/action_dispatch/middleware/request_id.rb:21:in `call'
2014-08-12T12:44:14.256095+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.5/lib/rails/application.rb:97:in `call'
2014-08-12T12:44:14.256102+00:00 app[web.1]: vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
2014-08-12T12:44:14.256083+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.5/lib/active_support/tagged_logging.rb:68:in `tagged'
Your link is to /resume/Saghir%20Resume1.docx (/resume/Saghir Resume1.docx) but you say its in the public folder -- is the upload directory /public/resume/file_name? And are you set for Rails to serve_static_assets?
As #CodeGnome pointed out, Heroku is an ephemeral filesystem so the entire approach is a bad idea -- typically you'd use Amazon S3 or a similar filestore for your uploaded files. Even if your routes are right, the file you uploaded can be on a different dyno because you're running more than one or because you've redeployed.
Heroku has something called the Ephemeral filesystem, so during the dyno’s lifetime its running processes can make use of it, but any file stored here will be discarded after the dyno has finished, so yes it does save the file, but after that it is deleted so it won't find it.
A very common approach is using paperclip and Amazon S3 for handling/storing the uploads, and those are pretty straightforward to install too. Here is a great article explaining how to do so: https://devcenter.heroku.com/articles/paperclip-s3
I'm following Michael Hartl's guide on learning Ruby on Rails and I just finished Chapter 5.
I get the localhost to load just fine and pages work and look as expected but when I try the final line to get heroku going "heroku open" I get the following screen (http://take.ms/4KuwQ).
I've tried checking other stackoverflow questions but still couldn't find the answer. The guide says to look at Heroku logs to debug but I can not find the solution.
Below is my entire Heroku log. I have also attached a screen grab (http://take.ms/MaJhz) of what I believe would be the issue but can not find the solution.
Entire GEM file:
source 'https://rubygems.org'
ruby '2.0.0'
#ruby-gemset=railstutorial_rails_4_0
gem 'rails', '4.0.4'
gem 'bootstrap-sass', '2.3.2.0'
gem 'sprockets', '2.11.0'
group :development, :test do
gem 'sqlite3', '1.3.8'
gem 'rspec-rails', '2.13.1'
end
group :test do
gem 'selenium-webdriver', '2.35.1'
gem 'capybara', '2.1.0'
end
gem 'sass-rails', '4.0.1'
gem 'uglifier', '2.1.1'
gem 'coffee-rails', '4.0.1'
gem 'jquery-rails', '3.0.4'
gem 'turbolinks', '1.1.1'
gem 'jbuilder', '1.0.2'
group :doc do
gem 'sdoc', '0.3.20', require: false
end
group :production do
gem 'pg', '0.15.1'
gem 'rails_12factor', '0.0.2'
end
Entire Heroku log:
2014-04-16T23:13:14.780234+00:00 app[web.1]: vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
2014-04-16T23:13:14.780234+00:00 app[web.1]: vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
2014-04-16T23:13:14.780234+00:00 app[web.1]: vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
2014-04-16T23:13:14.780234+00:00 app[web.1]:
2014-04-16T23:13:14.780234+00:00 app[web.1]:
2014-04-16T23:13:14.780234+00:00 app[web.1]:
2014-04-16T23:13:14.780234+00:00 app[web.1]: ActionController::RoutingError (No route matches [GET] "/"):
2014-04-16T23:13:14.780234+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
2014-04-16T23:13:14.781190+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/rack/logger.rb:38:in `call_app'
2014-04-16T23:13:14.781190+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/rack/logger.rb:20:in `block in call'
2014-04-16T23:13:14.781190+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/tagged_logging.rb:68:in `block in tagged'
2014-04-16T23:13:14.781190+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/tagged_logging.rb:68:in `tagged'
2014-04-16T23:13:14.781190+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/rack/logger.rb:20:in `call'
2014-04-16T23:13:14.781190+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_dispatch/middleware/request_id.rb:21:in `call'
2014-04-16T23:13:14.781190+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
2014-04-16T23:13:14.781574+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
2014-04-16T23:13:14.780234+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
2014-04-16T23:13:14.781190+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/tagged_logging.rb:26:in `tagged'
2014-04-16T23:13:14.781190+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/runtime.rb:17:in `call'
2014-04-16T23:13:14.781574+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
2014-04-16T23:13:14.781574+00:00 app[web.1]: vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
2014-04-16T23:13:14.781574+00:00 app[web.1]: vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
2014-04-16T23:13:14.781574+00:00 app[web.1]: vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
2014-04-16T23:13:14.781190+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/cache/strategy/local_cache.rb:83:in `call'
2014-04-16T23:13:14.781574+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_dispatch/middleware/static.rb:64:in `call'
2014-04-16T23:13:14
.781574+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/sendfile.rb:112:in `call'
2014-04-16T23:13:14.781574+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/engine.rb:511:in `call'
2014-04-16T23:13:14.781574+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/application.rb:97:in `call'
2014-04-16T23:13:14.781574+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
2014-04-16T23:13:14.782201+00:00 app[web.1]:
2014-04-16T23:13:14.782201+00:00 app[web.1]:
2014-04-16T23:13:14.783441+00:00 heroku[router]: at=info method=GET path=/ host=damp-inlet-1921.herokuapp.com request_id=f19f1fc7-892c-4b1f-adaa-324bc982b675 fwd="12.172.95.252" dyno=web.1 connect=1ms service=350ms status=404 bytes=1616
2014-04-16T23:13:15.127296+00:00 heroku[router]: at=info method=GET path=/favicon.ico host=damp-inlet-1921.herokuapp.com request_id=6b5c668d-189b-42d6-90b9-1bffb1d7f085 fwd="12.172.95.252" dyno=web.1 connect=1ms service=4ms status=304 bytes=133
2014-04-16T23:13:13.951347+00:00 heroku[web.1]: State changed from starting to up
2014-04-16T23:14:24.040669+00:00 heroku[api]: Starting process with command `bundle exec rake db:setup` by edgarmatevosyan#gmail.com
2014-04-16T23:14:27.184585+00:00 heroku[run.2955]: Awaiting client
2014-04-16T23:14:27.219046+00:00 heroku[run.2955]: Starting process with command `bundle exec rake db:setup`
2014-
04-16T23:14:27.274133+00:00 heroku[run.2955]: State changed from starting to up
2014-04-16T23:14:30.722822+00:00 heroku[run.2955]: State changed from up to complete
2014-04-16T23:14:30.708839+00:00 heroku[run.2955]: Process exited with status 1
2014-04-16T23:14:37.126865+00:00 heroku[api]: Starting process with command `bundle exec rake db:migrate` by edgarmatevosyan#gmail.com
2014-04-16T23:14:41.972185+00:00 heroku[run.8896]: Awaiting client
2014-04-16T23:14:41.719744+00:00 heroku[run.8896]: State changed from starting to up
2014-04-16T23:14:42.035485+00:00 heroku[run.8896]: Starting process with command `bundle exec rake db:migrate`
2014-04-16T23:14:48.674142+00:00 heroku[run.8896]: Process exited with status 0
2014-04-16T23:14:48.685250+00:00 heroku[run.8896]: State changed from up to complete
2014-04-16T23:23:59.044087+00:00 app[web.1]: Started GET "/" for 12.172.95.252 at 2014-04-16 23:23:59 +0000
2014-04-16T23:23:59.062462+00:00 app[web.1]: Started GET "/" for 12.172.95.252 at 2014-04-16 23:23:59 +0000
2014-04-16T23:23:59.289420+00:00 app[web.1]: ActionController::RoutingError (No route matches [GET] "/"):
2014-04-16T23:23:59.289420+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
2014-04-16T23:23:59.289420+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
201
4-04-16T23:23:59.289420+00:00 app[web.1]:
2014-04-16T23:23:59.289420+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/rack/logger.rb:38:in `call_app'
2014-04-16T23:23:59.289420+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/rack/logger.rb:20:in `block in call'
2014-04-16T23:23:59.289420+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/tagged_logging.rb:68:in `block in tagged'
2014-04-16T23:23:59.289420+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/tagged_logging.rb:26:in `tagged'
2014-04-16T23:23:59.289420+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/tagged_logging.rb:68:in `tagged'
2014-04-16T23:23:59.289420+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/rack/logger.rb:20:in `call'
2014-04-16T23:23:59.289665+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/engine.rb:511:in `call'
2014-04-16T23:23:59.289665+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/application.rb:97:in `call'
2014-04-16T23:23:59.289665+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
2014-04-16T23:23:59.289665+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
2014-04-16T23:23:59.289665+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_dispatch/middleware/request_id.rb:21:in `call'
2014-04-16T23:23:59.289665+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
2014-04-16T23:23:59.289665+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/runtime.rb:17:in `call'
2014-04-16T23:23:59.289665+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/cache/strategy/local_cache.rb:83:in `call'
2014-04-16T23:23:59.289665+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_dispatch/middleware/static.rb:64:in `call'
2014-04-16T23:23:59.289665+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/sendfile.rb:112:in `call'
2014-04-16T23:23:59.289857+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
2014-04-16T23:23:59.289857+00:00 app[web.1]: vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
2014-04-16T23:23:59.289857+00:00 app[web.1]: vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
2014-04-16T23:23:59.289857+00:00 app[web.1]: vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
2014-04-16T23:23:59.289857+00:00 app[web.1]:
2014-04-16T23:23:59.289857+00:00 app[web.1]:
2014-04-16T23:23:59.293033+00:00 app[web.1]:
2014-04-16T23:23:59.293033+00:00 app[web.1]: ActionController::RoutingError (No route matches [GET] "/"):
2014-04-16T23:23:59.293033+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
2014-04-16T23:23:59.293033+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
2014-04-16T23:23:59.293033+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/rack/logger.rb:38:in `call_app'
2014-04-16T23:23:59.293033+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/rack/logger.rb:20:in `block in call'
2014-04-16T23:23:59.293033+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/tagged_logging.rb:68:in `block in tagged'
2014-04-16T23:23:59.293033+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/tagged_logging.rb:26:in `tagged'
2014-04-16T23:23:59.293033+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/tagged_logging.rb:68:in `tagged'
2014-04-16T23:23:59.293250+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_dispatch/middleware/request_id.rb:21:in `call'
2014-04-16T23:23:59.293033+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/rack/logger.rb:20:in `call'
2014-04-16T23:23:59.293250+00:00 app[web.1]:
vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
2014-04-16T23:23:59.293250+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/runtime.rb:17:in `call'
2014-04-16T23:23:59.293250+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/cache/strategy/local_cache.rb:83:in `call'
2014-04-16T23:23:59.293250+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_dispatch/middleware/static.rb:64:in `call'
2014-04-16T23:23:59.293250+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/sendfile.rb:112:in `call'
2014-04-16T23:23:59.293250+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/engine.rb:511:in `call'
2014-04-16T23:23:59.293250+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/application.rb:97:in `call'
2014-04-16T23:23:59.293250+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
2014-04-16T23:23:59.293250+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
2014-04-16T23:23:59.293486+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
2014-04-16T23:23:59.293486+00:00 app[web.1]: vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
2014-04-16T23:23:59.293486+00:00 app[web.1]: vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
2014-04-16T23:23:59.293486+00:00 app[web.1]: vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
2014-04-16T23:23:59.293486+00:00 app[web.1]:
2014-04-16T23:23:59.293486+00:00 app[web.1]:
2014-04-16T23:23:59.317925+00:00 heroku[router]: at=info method=GET path=/ host=damp-inlet-1921.herokuapp.com request_id=b7a6b34b-bab5-4603-b19e-5e00f6239f27 fwd="12.172.95.252" dyno=web.1 connect=4ms service=4147ms status=404 bytes=1616
Here is the routes.rb file:
SampleApp::Application.routes.draw do
get "users/new"
root 'static_pages#home'
match '/signup', to: 'users#new', via: 'get'
match '/help', to: 'static_pages#help', via: 'get'
match '/about', to: 'static_pages#about', via: 'get'
match '/contact', to: 'static_pages#contact', via: 'get'
end
The screengrab log says no route matches a GET request on '/'. Are you sure you've set a root route? It would look like this: (the routes file is found in 'config/routes.rb')
root to: 'controller#method'
Where controller is the controller you wish to use 'users' or 'posts' etc..
and the method would most likely be an index method.
Take a quick look at routes.rb, and if you do have a line like I've mentioned above, just post up your routes.rb file for us to take a look.
I have been working on an app locally for a while now, and I've matched my development environment to that on Heroku as closely as I can.
The app is set up for multi-tenancy using Apartment (https://github.com/influitive/apartment), and designed to use subdomains to identify tenants. Both environments use postgres, and Apartment has been using schemas to manage the 'tanants' data.
This evening, I have attempted to push the code to Heroku (the same app before it became multi-tenancy worked beautifully), and no pages load, all give an error.
I've taken a look at the logs, and the most interesting line I can find is; Apartment::SchemaNotFound (One of the following schema(s) is invalid: heroku-app-name, "public"):
This certainly seems to be a peculiarity of Heroku, but I'm struggling for ideas on where to look next.
Any suggestions or help would be appreciated.
I've included all of the logs for reference;
2014-04-04T18:27:09.884367+00:00 app[web.1]: Apartment::SchemaNotFound (One of the following schema(s) is invalid: heroku-app-name, "public"):
2014-04-04T18:27:09.884368+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/apartment-0.24.3/lib/apartment/adapters/postgresql_adapter.rb:95:in `rescue in connect_to_new'
2014-04-04T18:27:09.884384+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/etag.rb:23:in `call'
2014-04-04T18:27:09.884362+00:00 app[web.1]:
2014-04-04T18:27:09.884385+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/conditionalget.rb:25:in `call'
2014-04-04T18:27:09.884364+00:00 app[web.1]: I, [2014-04-04T18:27:09.879482 #2] INFO -- : Started GET "/favicon.ico" for 92.25.163.224 at 2014-04-04 18:27:09 +0000
2014-04-04T18:27:09.884388+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/params_parser.rb:27:in `call'
2014-04-04T18:27:09.884389+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/flash.rb:241:in `call'
2014-04-04T18:27:09.884366+00:00 app[web.1]: F, [2014-04-04T18:27:09.884136 #2] FATAL -- :
2014-04-04T18:27:09.884370+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/apartment-0.24.3/lib/apartment/adapters/postgresql_adapter.rb:88:in `connect_to_new'
2014-04-04T18:27:09.884381+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/warden-1.2.3/lib/warden/manager.rb:34:in `catch'
2014-04-04T18:27:09.884371+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/apartment-0.24.3/lib/apartment/adapters/abstract_adapter.rb:100:in `switch'
2014-04-04T18:27:09.884383+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/warden-1.2.3/lib/warden/manager.rb:34:in `call'
2014-04-04T18:27:09.884396+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in `call'
2014-04-04T18:27:09.884372+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/apartment-0.24.3/lib/apartment/elevators/generic.rb:20:in `call'
2014-04-04T18:27:09.884387+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/head.rb:11:in `call'
2014-04-04T18:27:09.884398+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
2014-04-04T18:27:09.884403+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
2014-04-04T18:27:09.884391+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:225:in `context'
2014-04-04T18:27:09.884392+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:220:in `call'
2014-04-04T18:27:09.884399+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/callbacks.rb:373:in `_run__2212192162733263500__call__callbacks'
2014-04-04T18:27:09.884400+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/callbacks.rb:80:in `run_callbacks'
2014-04-04T18:27:09.884393+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/cookies.rb:486:in `call'
2014-04-04T18:27:09.884402+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
2014-04-04T18:27:09.884406+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
2014-04-04T18:27:09.884379+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/warden-1.2.3/lib/warden/manager.rb:35:in `block in call'
2014-04-04T18:27:09.884395+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/query_cache.rb:36:in `call'
2014-04-04T18:27:09.884409+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/rack/logger.rb:21:in `block in call'
2014-04-04T18:27:09.884407+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/rack/logger.rb:38:in `call_app'
2014-04-04T18:27:09.884410+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/tagged_logging.rb:67:in `block in tagged'
2014-04-04T18:27:09.884404+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
2014-04-04T18:27:09.884430+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/tagged_logging.rb:67:in `tagged'
2014-04-04T18:27:09.884431+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/rack/logger.rb:21:in `call'
2014-04-04T18:27:09.884432+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/request_id.rb:21:in `call'
2014-04-04T18:27:09.884428+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/tagged_logging.rb:25:in `tagged'
2014-04-04T18:27:09.884435+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/runtime.rb:17:in `call'
2014-04-04T18:27:09.884444+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:97:in `call'
2014-04-04T18:27:09.884434+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
2014-04-04T18:27:09.884437+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/cache/strategy/local_cache.rb:83:in `call'
2014-04-04T18:27:09.884442+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:511:in `call'
2014-04-04T18:27:09.884445+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
2014-04-04T18:27:09.884448+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
2014-04-04T18:27:09.884446+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
2014-04-04T18:27:09.884450+00:00 app[web.1]: vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
2014-04-04T18:27:09.884451+00:00 app[web.1]: vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
2014-04-04T18:27:09.884452+00:00 app[web.1]: vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
Take a look at your apartment initializer and remove the subdomain elevator settings. i commented out everything related to elevator. since your app is probably on a heroku subdomain, the elevator setting will try to load that particular tenant from the db and will issue that error.
it worked fine for me after i commented
# Rails.application.config.middleware.use 'Apartment::Elevators::Subdomain'
I'm trying to deploy a sample rails app on heroku. After creating a very basic app, adding a git repository, committing everything and "heroku create", I push it up to heroku. No errors at all in terminal, but when I open the browser with the correct address, I get the following:
The page you were looking for doesn't exist.
You may have mistyped the address or the page may have moved.
I've searched for three hours and used the heroku tutorial on how to deploy the app but I just can't figure out what I'm doing wrong.
Here is my Gemfile:
source 'https://rubygems.org'
ruby '2.0.0'
gem 'rails', '4.0.0.beta1'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'json'
group :production do
gem 'pg'
gem 'rails', '4.0.0.beta1'
gem 'railties', '4.0.0.beta1'
end
# Gems used only for assets and not required
# in production environments by default.
group :assets do
#gem 'sass-rails', '~> 3.2.3'
gem 'sass-rails', '~> 4.0.0.beta1'
#gem 'coffee-rails', '~> 3.2.1'
gem 'coffee-rails', '~> 4.0.0.beta1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
I've repeated the steps above several times, didn't work. Thanks!
Edit: added heroku console logs:
2013-04-13T14:15:14.800540+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0.beta1/lib/rails/commands/server.rb:80:in `start'
2013-04-13T14:15:14.801066+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0.beta1/lib/rails/commands.rb:73:in `<top (required)>'
2013-04-13T14:15:14.801066+00:00 app[web.1]: script/rails:6:in `<main>'
2013-04-13T14:15:14.801375+00:00 app[web.1]: [2013-04-13 14:15:14] INFO going to shutdown ...
2013-04-13T14:15:14.801542+00:00 app[web.1]: [2013-04-13 14:15:14] INFO WEBrick::HTTPServer#start done.
2013-04-13T14:15:14.801066+00:00 app[web.1]: script/rails:6:in `require'
2013-04-13T14:15:14.800540+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0.beta1/lib/rails/commands.rb:73:in `tap'
2013-04-13T14:15:14.822878+00:00 app[web.1]: => Booting WEBrick
2013-04-13T14:15:14.822878+00:00 app[web.1]: => Rails 4.0.0.beta1 application starting in production on http://0.0.0.0:44478
2013-04-13T14:15:14.822878+00:00 app[web.1]: => Call with -d to detach
2013-04-13T14:15:14.822878+00:00 app[web.1]: => Ctrl-C to shutdown server
2013-04-13T14:15:14.822878+00:00 app[web.1]:
2013-04-13T14:15:14.822878+00:00 app[web.1]: ActionController::RoutingError (No route matches [GET] "/"):
2013-04-13T14:15:14.823204+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.0.beta1/lib/rails/rack/logger.rb:21:in `block in call'
2013-04-13T14:15:14.822878+00:00 app[web.1]: Started GET "/" for 178.25.122.239 at 2013-04-13 14:02:08 +0000
2013-04-13T14:15:14.822878+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.0.beta1/lib/rails/rack/logger.rb:38:in `call_app'
2013-04-13T14:15:14.823204+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.0.beta1/lib/rails/rack/logger.rb:21:in `call'
2013-04-13T14:15:14.823204+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0.beta1/lib/active_support/tagged_logging.rb:67:in `tagged'
2013-04-13T14:15:14.822878+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0.beta1/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
2013-04-13T14:15:14.823204+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0.beta1/lib/active_support/tagged_logging.rb:25:in `tagged'
2013-04-13T14:15:14.823204+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
2013-04-13T14:15:14.823433+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
2013-04-13T14:15:14.823204+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/runtime.rb:17:in `call'
2013-04-13T14:15:14.823204+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.0.beta1/lib/rails/engine.rb:510:in `call'
2013-04-13T14:15:14.823433+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.0.beta1/lib/rails/application.rb:96:in `call'
2013-04-13T14:15:14.823433+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
2013-04-13T14:15:14.823433+00:00 app[web.1]: vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
2013-04-13T14:15:14.822878+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0.beta1/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
2013-04-13T14:15:14.823433+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
2013-04-13T14:15:14.823204+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0.beta1/lib/action_dispatch/middleware/request_id.rb:21:in `call'
2013-04-13T14:15:14.823204+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0.beta1/lib/active_support/tagged_logging.rb:67:in `block in tagged'
2013-04-13T14:15:14.823433+00:00 app[web.1]: vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
2013-04-13T14:15:14.823204+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0.beta1/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
2013-04-13T14:15:14.823433+00:00 app[web.1]: vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
2013-04-13T14:15:14.823433+00:00 app[web.1]:
2013-04-13T14:15:14.823433+00:00 app[web.1]: Started GET "/" for 178.25.122.239 at 2013-04-13 14:04:08 +0000
2013-04-13T14:15:14.823433+00:00 app[web.1]:
2013-04-13T14:15:14.823657+00:00 app[web.1]:
2013-04-13T14:15:14.823657+00:00 app[web.1]: ActionController::RoutingError (No route matches [GET] "/"):
2013-04-13T14:15:14.823657+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0.beta1/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
2013-04-13T14:15:14.823657+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0.beta1/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
2013-04-13T14:15:14.823657+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.0.beta1/lib/rails/rack/logger.rb:38:in `call_app'
2013-04-13T14:15:14.823657+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.0.beta1/lib/rails/rack/logger.rb:21:in `block in call'
2013-04-13T14:15:14.823657+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0.beta1/lib/active_support/tagged_logging.rb:67:in `block in tagged'
2013-04-13T14:15:14.823657+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0.beta1/lib/active_support/tagged_logging.rb:25:in `tagged'
2013-04-13T14:15:14.823657+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0.beta1/lib/active_support/tagged_logging.rb:67:in `tagged'
2013-04-13T14:15:14.823657+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.0.beta1/lib/rails/rack/logger.rb:21:in `call'
2013-04-13T14:15:14.823871+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
2013-04-13T14:15:14.823871+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0.beta1/lib/action_dispatch/middleware/request_id.rb:21:in `call'
2013-04-13T14:15:14.823871+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0.beta1/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
2013-04-13T14:15:14.823871+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.0.beta1/lib/rails/engine.rb:510:in `call'
2013-04-13T14:15:14.823871+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/runtime.rb:17:in `call'
2013-04-13T14:15:14.823871+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.0.beta1/lib/rails/application.rb:96:in `call'
2013-04-13T14:15:14.823871+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
2013-04-13T14:15:14.823871+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
2013-04-13T14:15:14.823871+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
2013-04-13T14:15:14.823871+00:00 app[web.1]: vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
2013-04-13T14:15:14.824082+00:00 app[web.1]: vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
2013-04-13T14:15:14.824082+00:00 app[web.1]: vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
2013-04-13T14:15:14.824082+00:00 app[web.1]:
2013-04-13T14:15:14.824082+00:00 app[web.1]:
2013-04-13T14:15:14.824082+00:00 app[web.1]: Started GET "/favicon.ico" for 178.25.122.239 at 2013-04-13 14:04:09 +0000
2013-04-13T14:15:14.824082+00:00 app[web.1]:
2013-04-13T14:15:14.824082+00:00 app[web.1]: ActionController::RoutingError (No route matches [GET] "/favicon.ico"):
2013-04-13T14:15:14.824082+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0.beta1/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
2013-04-13T14:15:14.824082+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0.beta1/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
2013-04-13T14:15:14.824082+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.0.beta1/lib/rails/rack/logger.rb:38:in `call_app'
2013-04-13T14:15:14.824292+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.0.beta1/lib/rails/rack/logger.rb:21:in `block in call'
2013-04-13T14:15:14.824292+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0.beta1/lib/active_support/tagged_logging.rb:67:in `block in tagged'
2013-04-13T14:15:14.824292+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0.beta1/lib/active_support/tagged_logging.rb:67:in `tagged'
2013-04-13T14:15:14.824292+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.0.beta1/lib/rails/rack/logger.rb:21:in `call'
2013-04-13T14:15:14.824292+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0.beta1/lib/active_support/tagged_logging.rb:25:in `tagged'
2013-04-13T14:15:14.824292+00:00 app[web.1]: vendor/bu
ndle/ruby/2.0.0/gems/actionpack-4.0.0.beta1/lib/action_dispatch/middleware/request_id.rb:21:in `call'
2013-04-13T14:15:14.824292+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
2013-04-13T14:15:14.824292+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/runtime.rb:17:in `call'
2013-04-13T14:15:14.824503+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
2013-04-13T14:15:14.824292+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0.beta1/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
2013-04-13T14:15:14.824292+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.0.beta1/lib/rails/engine.rb:510:in `call'
2013-04-13T14:15:14.824503+00:00 app[web.1]: vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
2013-04-13T14:15:14.824503+00:00 app[web.1]: vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
2013-04-13T14:15:14.824503+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
2013-04-13T14:15:14.824503+00:00 app[web.1]:
2013-04-13T14:15:14.824503+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
2013-04-13T14:15:14.824503+00:00 app[web.1]: Exiting
2013-04-13T14:15:14.824503+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.0.beta1/lib/rails/application.rb:96:in `call'
2013-04-13T14:15:14.824503+00:00 app[web.1]: vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
2013-04-13T14:15:14.824503+00:00 app[web.1]:
2013-04-13T14:15:14.516222+00:00 heroku[web.1]: State changed from starting to up
2013-04-13T14:15:16.056837+00:00 heroku[web.1]: Process exited with status 143
2013-04-13T14:16:05.609544+00:00 app[web.1]:
2013-04-13T14:16:05.609544+00:00 app[web.1]: To disable this message remove the `whitelist_attributes` option from your
2013-04-13T14:16:05.609544+00:00 app[web.1]: DEPRECATION WARNING: Model based mass assignment security has been extracted
2013-04-13T14:16:05.609544+00:00 app[web.1]: out of Rails into a gem. Please use the new recommended protection model for
2013-04-13T14:16:05.609544+00:00 app[web.1]: params or add `protected_attributes` to your Gemfile to use the old one.
2013-04-13T14:16:05.609544+00:00 app[web.1]: `config/application.rb` file and any `mass_assignment_sanitizer` options
2013-04-13T14:16:05.609544+00:00 app[web.1]: See http://guides.rubyonrails.org/security.html#mass-assignment for more information.
2013-04-13T14:16:05.609544+00:00 app[web.1]:
2013-04-13T14:16:05.609544+00:00 app[web.1]:
2013-04-13T14:16:05.609544+00:00 app[web.1]: from your `config/environments/*.rb` files.
2013-04-13T14:16:05.730223+00:00 heroku[router]: at=info method=GET path=/ host=mighty-depths-7233.herokuapp.com fwd="178.25.122.239" dyno=web.1 connect=1ms service=209ms status=404 bytes=728
2013-04-13T14:16:05.980431+00:00 heroku[router]: at=info method=GET path=/favicon.ico host=mighty-depths-7233.herokuapp.com fwd="178.25.122.239" dyno=web.1 connect=0ms service=6ms status=404 bytes=728
First of all there's a good guide on routing in Rails here.
Lets say you have an Article model in your app and an articles controller, you have to define the routes for this resource under config/routes.rb. Rails allows you to add routes for index, show new, create, edit, update and destroy in one line:
resources :articles
This will map to the following:
GET /articles index display a list of all articles
GET /articles/new new return an HTML form for creating a new article
POST /articles create create a new article
GET /articles/:id show display a specific article
GET /articles/:id/edit edit return an HTML form for editing a article
PUT /articles/:id update update a specific article
DELETE /articles/:id destroy delete a specific article
However to make sure that the homepage routes to one of these actions you need to define root under config/routes.rb
root to: "articles#index"
Then commit and push it to heroku again.
I notice that you're trying (probably unintentionally) to use an 'edge' version of rails (4+).
I would stick with a 3.x version for now and that's what the tutorial is probably assuming.
You can use this to create an app with a specific version (3.2 in this case)
rails _3.2_ new myapp
If you don't have that version of rails on your system you may need to install it, e.g.
gem install -v=3.2 rails
or, if that fails,
sudo gem install rails -v3.2
The above is why, when you follow the current Heroku instructions it assumes rails 3 and that version does do that default root path and the public/index.html file
I'm still quite a newb to this, but to provide some background:
I built up a decent app and followed the proper steps to deploy it to Heroku, when I run the 'Heroku open' command, I get:
*"We're sorry, but something went wrong."
(in the opened window.)
Hope we can solve this! I've attached the Heroku logs:
To git#heroku.com:startupblog.git
390c9dc..37f5a3d master -> master
[StartupBlog]$heroku open
Opening startupblog... done
[StartupBlog]$heroku log
! `log` is not a heroku command.
! Perhaps you meant `logs`.
! See `heroku help` for a list of available commands.
[StartupBlog]$heroku logs
2013-02-26T08:25:42+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.11/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
2013-02-26T08:25:42+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:405:in `_run__3231968123246769760__call__1023772550130159371__callbacks'
2013-02-26T08:25:42+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
2013-02-26T08:25:42+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:405:in `__run_callback'
2013-02-26T08:25:42+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.11/lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
2013-02-26T08:25:42+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:81:in `run_callbacks'
2013-02-26T08:25:42+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.11/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
2013-02-26T08:25:42+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.11/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
2013-02-26T08:25:42+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.11/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
2013-02-26T08:25:42+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/rack/logger.rb:32:in `call_app'
2013-02-26T08:25:42+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.11/lib/active_support/tagged_logging.rb:22:in `tagged'
2013-02-26T08:25:42+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/rack/logger.rb:16:in `call'
2013-02-26T08:25:42+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.11/lib/action_dispatch/middleware/request_id.rb:22:in `call'
2013-02-26T08:25:42+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/methodoverride.rb:21:in `call'
2013-02-26T08:25:42+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.11/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
2013-02-26T08:25:42+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/lock.rb:15:in `call'
2013-02-26T08:25:42+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.11/lib/action_dispatch/middleware/static.rb:62:in `call'
2013-02-26T08:25:42+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in `forward'
2013-02-26T08:25:42+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/rack/logger.rb:16:in `block in call'
2013-02-26T08:25:42+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/runtime.rb:17:in `call'
2013-02-26T08:25:42+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:185:in `lookup'
2013-02-26T08:25:42+00:00 app[web.1]:
2013-02-26T08:25:42+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:245:in `fetch'
2013-02-26T08:25:42+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:66:in `call!'
2013-02-26T08:25:42+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in `call'
2013-02-26T08:25:42+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/engine.rb:479:in `call'
2013-02-26T08:25:42+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/application.rb:223:in `call'
2013-02-26T08:25:42+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/rack/log_tailer.rb:17:in `call'
2013-02-26T08:25:42+00:00 app[web.1]: /usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
2013-02-26T08:25:42+00:00 app[web.1]:
2013-02-26T08:25:42+00:00 app[web.1]: /usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
2013-02-26T08:25:42+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/content_length.rb:14:in `call'
2013-02-26T08:25:42+00:00 app[web.1]: /usr/local/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
2013-02-26T08:25:42+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/handler/webrick.rb:59:in `service'
2013-02-26T08:30:59+00:00 heroku[slugc]: Slug compilation started
2013-02-26T08:31:30+00:00 heroku[api]: Release v7 created by anthony.panepinto101#gmail.com
2013-02-26T08:31:30+00:00 heroku[api]: Deploy 37f5a3d by anthony.panepinto101#gmail.com
2013-02-26T08:31:30+00:00 heroku[web.1]: State changed from up to starting
2013-02-26T08:31:31+00:00 heroku[slugc]: Slug compilation finished
2013-02-26T08:31:32+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 41761`
2013-02-26T08:31:34+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2013-02-26T08:31:35+00:00 app[web.1]: [2013-02-26 08:31:35] ERROR SignalException: SIGTERM
2013-02-26T08:31:35+00:00 app[web.1]: /usr/local/lib/ruby/1.9.1/webrick/server.rb:90:in `select'
2013-02-26T08:31:36+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5)
2013-02-26T08:31:36+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5)
2013-02-26T08:31:40+00:00 app[web.1]: [2013-02-26 08:31:40] INFO WEBrick 1.3.1
2013-02-26T08:31:40+00:00 app[web.1]: [2013-02-26 08:31:40] INFO ruby 1.9.2 (2011-07-09) [x86_64-linux]
2013-02-26T08:31:40+00:00 app[web.1]: [2013-02-26 08:31:40] INFO WEBrick::HTTPServer#start: pid=2 port=41761
2013-02-26T08:31:41+00:00 heroku[web.1]: State changed from starting to up
2013-02-26T08:31:45+00:00 heroku[web.1]: Error R12 (Exit timeout) -> At least one process failed to exit within 10 seconds of SIGTERM
2013-02-26T08:31:45+00:00 heroku[web.1]: Stopping remaining processes with SIGKILL
2013-02-26T08:31:46+00:00 app[web.1]: => Call with -d to detach
2013-02-26T08:31:46+00:00 app[web.1]: => Ctrl-C to shutdown server
2013-02-26T08:31:46+00:00 app[web.1]: => Booting WEBrick
2013-02-26T08:31:46+00:00 app[web.1]: => Rails 3.2.11 application starting in production on http://0.0.0.0:41761
2013-02-26T08:31:46+00:00 app[web.1]: Started GET "/" for 174.95.207.136 at 2013-02-26 08:31:46 +0000
2013-02-26T08:31:47+00:00 heroku[web.1]: Process exited with status 137
2013-02-26T08:31:47+00:00 app[web.1]: Connecting to database specified by DATABASE_URL
2013-02-26T08:31:47+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.11/lib/active_record/query_cache.rb:67:in `rescue in call'
2013-02-26T08:31:47+00:00 heroku[router]: at=info method=GET path=/ host=startupblog.herokuapp.com fwd="174.95.207.136" dyno=web.1 queue=0 wait=0ms connect=2ms service=1011ms status=500 bytes=643
2013-02-26T08:31:47+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
2013-02-26T08:31:47+00:00 app[web.1]:
2013-02-26T08:31:47+00:00 app[web.1]: ActiveRecord::ConnectionNotEstablished (ActiveRecord::ConnectionNotEstablished):
2013-02-26T08:31:47+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:410:in `retrieve_connection'
2013-02-26T08:31:47+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_specification.rb:171:in `retrieve_connection'
2013-02-26T08:31:47+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_specification.rb:145:in `connection'
2013-02-26T08:31:47+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.11/lib/action_dispatch/middleware/request_id.rb:22:in `call'
2013-02-26T08:31:47+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/methodoverride.rb:21:in `call'
2013-02-26T08:31:47+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.11/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
2013-02-26T08:31:47+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.11/lib/action_dispatch/middleware/static.rb:62:in `call'
2013-02-26T08:31:47+00:00 app[web.1]: vendor/bundl
e/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in `call'
2013-02-26T08:31:47+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/rack/logger.rb:32:in `call_app'
2013-02-26T08:31:47+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in `forward'
2013-02-26T08:31:47+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:66:in `call!'
2013-02-26T08:31:47+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:405:in `_run__646234206873509914__call__2059469811213840144__callbacks'
2013-02-26T08:31:47+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.11/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
2013-02-26T08:31:47+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/runtime.rb:17:in `call'
2013-02-26T08:31:47+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:405:in `__run_callback'
2013-02-26T08:31:47+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/handler/webrick.rb:59:in `service'
2013-02-26T08:31:47+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/lock.rb:15:in `call'
2013-02-26T08:31:47+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.11/lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
2013-02-26T08:31:47+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/rack/log_tailer.rb:17:in `call'
2013-02-26T08:31:47+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/content_length.rb:14:in `call'
2013-02-26T08:31:47+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/rack/logger.rb:16:in `block in call'
2013-02-26T08:31:47+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.11/lib/active_record/query_cache.rb:61:in `call'
2013-02-26T08:31:47+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
2013-02-26T08:31:47+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/engine.rb:479:in `call'
2013-02-26T08:31:47+00:00 app[web.1]: /usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
2013-02-26T08:31:47+00:00 app[web.1]: /usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
2013-02-26T08:31:47+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.11/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
2013-02-26T08:31:47+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.11/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
2013-02-26T08:31:47+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:185:in `lookup'
2013-02-26T08:31:47+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:245:in `fetch'
2013-02-26T08:31:47+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:81:in `run_callbacks'
2013-02-26T08:31:47+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.11/lib/active_support/tagged_logging.rb:22:in `tagged'
2013-02-26T08:31:47+00:00 app[web.1]:
2013-02-26T08:31:47+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/application.rb:223:in `call'
2013-02-26T08:31:47+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.11/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
2013-02-26T08:31:47+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/rack/logger.rb:16:in `call'
2013-02-26T08:31:47+00:00 app[web.1]: /usr/local/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
2013-02-26T08:31:47+00:00 app[web.1]:
Gemfile contents:
source 'https://rubygems.org'
gem 'rails', '3.2.11'
group :development do
gem 'sqlite3', '1.3.5'
end
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '3.2.5'
gem 'bootstrap-sass', '~> 2.3.0.1'
gem 'coffee-rails', '3.2.2'
gem 'uglifier', '1.2.3'
end
gem 'jquery-rails', '2.0.2'
You should create a production database (probably pg) and then initiate the database. You should probably run heroku run rake db:migrate