My Rails 3 Bundler gem works locally but not on Heroku for serving certain layout files. Any ideas?

710 Views Asked by At

I am playing around with the Social Stream gem, a social networking platform built for Rails 3, which seems to pull some of its view layout files from a gem directory, rather than locally within the app file system. This works fine when I serve the app locally:

Rendered /Library/Ruby/Gems/1.8/gems/social_stream-0.4.4/app/views/frontpage/_header.html.erb (107.8ms)
Rendered /Library/Ruby/Gems/1.8/gems/social_stream-0.4.4/app/views/layouts/_flash.html.erb (0.6ms) Rendered /Library/Ruby/Gems/1.8/gems/social_stream-0.4.4/app/views/frontpage/_sponsor.html.erb (0.6ms)
Rendered /Library/Ruby/Gems/1.8/gems/social_stream-0.4.4/app/views/layouts/_footer.html.erb (1.1ms)
Rendered /Library/Ruby/Gems/1.8/gems/social_stream-0.4.4/app/views/frontpage/index.html.erb within layouts/frontpage (322.2ms)
Completed 200 OK in 374ms (Views: 372.6ms | ActiveRecord: 0.2ms)

I followed the instructions for deploying a Social Stream app to Heroku word for word, using Bundler to install the gems locally and create a Gemfile.lock file.

https://github.com/ging/social_stream/wiki/How-to-deploy-social-stream-to-heroku

When I deploy to Heroku, though, some pages don't load properly, and this is the error message I find in the logs:

ActionView::Template::Error (Missing partial layouts/flash with {:locale=>[:en, :en], :formats=>[:html], :handlers=>[:rjs, :rhtml, :rxml, :builder, :erb]} in view paths "/app/app>/views", "/app/vendor/plugins/rails_log_stdout/app/views", "/app/vendor/plugins/rails3_serve_static_assets/app/views", "/app/vendor/plugins/rails3_disable_x_sendfile/app/views", "/app/.bundle/gems/ruby/1.8/gems/social_stream-0.4.4/app/views", "/app/.bundle/gems/ruby/1.8/gems/devise-1.3.4/app/views", "/app/.bundle/gems/ruby/1.8/gems/mailboxer-0.1.4/app/views")

I don't understand what is preventing the layouts/flash file from being present on Heroku's server. Any ideas? Let me know if more info would be useful.

Thanks in advance.

1

There are 1 best solutions below

0
On

I had the same problem. To find out if the partial was really there, I created a controller method like:

def files
  render :text => Dir['**/*']
end

I found that the file was definitely there. After a bit more experimentation, I discovered my problem was that I was doing this:

render :partial => 'shared/partial'

rather than this:

render :partial => 'shared/partial.html.erb'