I have a rails 3.0.9 application that I am currently trying to deploy. The application runs fine on my dev box (ruby 1.8.7 p352, mongrel) but produces the following error on the production box (ruby 1.8.7 p334, Passenger).
A ActionView::Template::Error occurred in site#index:
can't convert nil into String
vendor/bundle/ruby/1.8/gems/actionpack-3.0.9/lib/action_view/helpers/asset_tag_helper.rb:888:in `read'
Stack Trace is:
vendor/bundle/ruby/1.8/gems/actionpack-3.0.9/lib/action_view/helpers/asset_tag_helper.rb:888:in `read'
vendor/bundle/ruby/1.8/gems/actionpack-3.0.9/lib/action_view/helpers/asset_tag_helper.rb:888:in `join_asset_file_contents'
vendor/bundle/ruby/1.8/gems/actionpack-3.0.9/lib/action_view/helpers/asset_tag_helper.rb:888:in `collect'
vendor/bundle/ruby/1.8/gems/actionpack-3.0.9/lib/action_view/helpers/asset_tag_helper.rb:888:in `join_asset_file_contents'
vendor/bundle/ruby/1.8/gems/actionpack-3.0.9/lib/action_view/helpers/asset_tag_helper.rb:894:in `write_asset_file_contents'
vendor/bundle/ruby/1.8/gems/activesupport-3.0.9/lib/active_support/core_ext/file/atomic.rb:20:in `atomic_write'
vendor/bundle/ruby/1.8/gems/actionpack-3.0.9/lib/action_view/helpers/asset_tag_helper.rb:894:in `write_asset_file_contents'
vendor/bundle/ruby/1.8/gems/actionpack-3.0.9/lib/action_view/helpers/asset_tag_helper.rb:356:in `javascript_include_tag'
app/views/layouts/application.html.erb:79:in `_app_views_layouts_application_html_erb___689799961_85527100_0'
Line 79 of application.html.erb is:
<%= javascript_include_tag (Rails.env.development? ? "jquery.min.js" : "http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"),
"jquery-ui.min",
"application", :cache => true %>
I have tried removing the conditional from the javascript_include_Tag but that doesn’t make any difference
You can only use the
:cache=>trueoption if all the arguments are actually files on your server – rails won’t go and fetch jquery from googleapis for you (and it would rather defeat the point if it did)Put the jquery.min.js include in its own
javascript_include_tag, without the:cacheoption and you should be fine. Alternatively you could stop trying to load jquery from googleapis.