I’ve followed the Agile Web D. with Rails book and I’m up to
deployment. I started a Ubuntu 10.1 LTS server on Amazon EC2 for
testing, got Apache 2, mysql, rvm, ruby 1.9.2, rails 3.1 and phusion
passenger up and running as per the book.
When I come to running the actual site, it says “We’re sorry, but
something went wrong.”
In production/log, I get this:
Started GET “/” for 188.8.131.52 at 2011-12-26 22:21:44 +0000
Processing by StoreController#index as HTML
Rendered store/index.html.erb within layouts/application (1.2ms)
Completed 500 Internal Server Error in 3ms
ActionView::Template::Error (cs.jpg isn’t precompiled):
7: <%# for each product %>
8: <% @products.each do |product| %>
10: <%= image_tag(product.image_url) %>
<%= product.title %>
12: <%= sanitize(product.description) %>
block in _app_views_store_index_html_erb___592600891_86859330' app/views/store/index.html.erb:8:in_app_views_store_index_html_erb___592600891_86859330’
I’ve searched for this and found that someone else had the proposed
solution of running:
bundle exec rake assets:precompile
This has not worked for me and I get the same result above.
I decided to change the environment to development and the site
now being included twice. When I click add to cart, it ends up adding
two products to cart instead of one, etc. On my local machine, it all
runs fine (of course).
Could someone help explain to me what is wrong here and help point me
in the right direction? Much appreciated.