4 ms·
That's weird. http://www.cupidwithfriends.com http://www.cupidwithfriends.com is running rails 4 and been on heroku for the past week. Our Gemfile: source
by siong1987 14y ago
That's weird. http://www.cupidwithfriends.com http://www.cupidwithfriends.com is running rails 4 and been on heroku for the past week. Our Gemfile:
source 'https://rubygems.org'
ruby '1.9.3'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0.beta1'
- mhartl 14y agoThanks. I think I know what the problem is. Tracking it down now... Edit: Yes, I figured it out. In Rails 4.0, the default page for a new app is no longer served as a static file from the public/ directory. Instead, something magical happens, and the magic doesn't work on Heroku. That's no worry, though, as it only means the first app doesn't work. The other apps, which set root routes, should work fine. They don't, though. I can't get the main sample app's CSS or images to load properly. Hmm... Bleeding edge indeed. Update: You need to edit the default production.rb file to configure Rails to serve static assets: config.serve_static_assets = true Thanks to ninthfrank07 for his link at https://news.ycombinator.com/item?id=5411964 https://news.ycombinator.com/item?id=5411964 that included the solution.
- steveklabnik 14y ago> Instead, something magical happens, and the magic doesn't work on Heroku. To be clear, this is because the 'Welcome page' shows info about the server, so you NEVER want that accidentally leaked to the world at large by accident, so the route gets disabled in production mode.
- mhartl 14y agoYou're right, of course, but it's not just that. In previous versions of Rails, the default page (a static file served out of the public/ directory) worked just fine on Heroku. It was only the magical “About your application’s environment” link that didn't work. In Rails 4.0, the static file is gone, and as far as I can tell the entire default page is magic, so on Heroku it breaks in its entirety, too. It's not a big deal of course, as in any real app you'll quickly define a root route and be done with it. (I do consider it a feature, too, as I really like not having to remove the static file by hand.)