I have a project where I'm upgrading a ruby-1.8.7-p72/rails 2.3.2/mongrel app. The first step I'm taking is to upgrade to ruby-1.9.3-p484 and rails 2.3.18 and unicorn.
I'm now at the point where I'm able to get the app to run on a dev server via unicorn (deploy via capistrano - rvm-capistrano and capistrano-unicorn). However, it's unable to serve any assets (images, stylesheets, etc)
I see errors in the unicorn log like:
ActionController::RoutingError (No route matches "/images/pp.jpg" with {:method=>:get}):
<internal:prelude>:10:in `synchronize'
unicorn (4.8.2) lib/unicorn/http_server.rb:572:in `process_client'
unicorn (4.8.2) lib/unicorn/http_server.rb:666:in `worker_loop'
unicorn (4.8.2) lib/unicorn/http_server.rb:521:in `spawn_missing_workers'
unicorn (4.8.2) lib/unicorn/http_server.rb:140:in `start'
unicorn (4.8.2) bin/unicorn_rails:209:in `<top (required)>'
/Users/ruby/.rvm/gems/ruby-1.9.3-p484/bin/unicorn_rails:19:in `load'
/Users/ruby/.rvm/gems/ruby-1.9.3-p484/bin/unicorn_rails:19:in `<main>'
/Users/ruby/.rvm/gems/ruby-1.9.3-p484/bin/ruby_executable_hooks:15:in `eval'
/Users/ruby/.rvm/gems/ruby-1.9.3-p484/bin/ruby_executable_hooks:15:in `<main>'
I see this same error whether I talk to the unicorn port directly or whether I go through apache (mod_rewrite - talking to the unicorn port)
Do I need to change my location of my assets? Currently they're under /public. They work fine here under ruby-1.8.7-p72/rails 2.3.2/mongrel but aren't working under ruby-1.9.3-p484/rails 2.3.18/unicorn. Or is there a config item I can put in my cap files that sets the location of the assets? I haven't found anything in the unicorn docs.
Anyone else go through this and knows the answer? I'll keep slogging through it, but any hints will be appreciated.
I finally got this working.... what a pain. I'm glad I only have to do this once. Actually, I've only got it worknig on my dev server. I don't think it's possible to use unicorn on my dev computer until I move to rails 3 because of the missing serve_static_assets config value.
My unicorn config file looks like:
My cap deploy looks like:
My apache conf looks like: