eregon / app2engine

Ease the conversion of a Rails 3 app in an Engine
http://github.com/eregon/app2engine
MIT License
32 stars 0 forks source link

Serving static assets #1

Closed krschacht closed 14 years ago

krschacht commented 14 years ago

Even with the updated actiondispatch line, I still can't get my public assets to serve in production. They only serve when the gem line is pointing to my local code.

eregon commented 14 years ago

Even with the updated actiondispatch line, I still can't get my public assets to serve in production

I tried today with Rails 3.0.0, locally, with Webrick, and it worked.

I initially got some trouble because I did not change the necessary configuration in the main application.

So, to serve static assets in production, you need to do:

The latter is already written in the ReadMe, but not very clearly.

They only serve when the gem line is pointing to my local code.

Do you mean you publish your engine gem on rubygems? (and so not using it with a :path => /path/to/engine). It should work, but I did not try myself, because the public folder is included in the gem:

Gem::Specification.new do |spec|
  spec.files = Dir["{app,config,public,lib}/**/*"]
end

So, can you serve static files locally in the production environment (RAILS_ENV=production rails s), or is it only a problem when deployed?

If so, can you show me the line in your Gemfile for the engine?

krschacht commented 14 years ago

Ahh, it was the spec files for me. I had broken that on my end. Adding public fixed everything, thanks!