Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How does one rake assetpack:build assets to public folder in a Sinatra classic app? (Also: If precompiling is unnecessary, how to serve static assets with Apache?) #174

Open
alancwoo opened this issue May 26, 2014 · 2 comments

Comments

@alancwoo
Copy link

I was wondering how to build out my assets via rake assetpack:build if I am creating a classic app? I am unable to precompile the assets if I don't define APP_CLASS = 'App'.

Defining APP_CLASS = 'App' results in the error: NameError: uninitialized constant App

A further question I have is, the documentation mentions that precompiling is unnecessary. I was wondering then, how to ensure that these static assets will be served by Apache (or other web server) when deploying the app? Would it simply be a matter of reconfiguring AssetPack to serve from and build to the public directory instead of /App?

@alancwoo alancwoo changed the title How does one rake assetpack:build assets to public folder in a Sinatra classic app? How does one rake assetpack:build assets to public folder in a Sinatra classic app? (& If precompiling is unnecessary, how to serve static assets with Apache?) May 26, 2014
@alancwoo alancwoo changed the title How does one rake assetpack:build assets to public folder in a Sinatra classic app? (& If precompiling is unnecessary, how to serve static assets with Apache?) How does one rake assetpack:build assets to public folder in a Sinatra classic app? (Also: If precompiling is unnecessary, how to serve static assets with Apache?) May 26, 2014
@lpil
Copy link

lpil commented Jun 26, 2014

Have you tried this?

APP_CLASS = 'Sinatra::Application'

@rstacruz
Copy link
Owner

A further question I have is, the documentation mentions that precompiling is unnecessary. I was wondering then, how to ensure that these static assets will be served by Apache (or other web server) when deploying the app?

Precompiling is "unnecessary" because they're served dynamically by the Sinatra app. This isn't exactly always the most ideal thing, but it works on almost all setups (most notably Heroku). If you need Apache to serve the assets statically, add the precompilation step to your deployment process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants