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

"Assets should not be requested directly" - Rails 4.2.0.beta4 #768

Closed
radar opened this issue Nov 4, 2014 · 3 comments
Closed

"Assets should not be requested directly" - Rails 4.2.0.beta4 #768

radar opened this issue Nov 4, 2014 · 3 comments

Comments

@radar
Copy link

radar commented Nov 4, 2014

I'm seeing this error with Rails 4.2.0.beta4 and bootstrap-sass 3.3.0.1:

Sprockets::Rails::Environment::NoDigestError (Assets should not be requested directly without their digests: Use the helpers in ActionView::Helpers to request bootstrap):
  sprockets-rails (3.0.0.beta1) lib/sprockets/rails/environment.rb:22:in `call'
  actionpack (4.2.0.beta4) lib/action_dispatch/routing/mapper.rb:51:in `serve'
  actionpack (4.2.0.beta4) lib/action_dispatch/journey/router.rb:43:in `block in serve'
  actionpack (4.2.0.beta4) lib/action_dispatch/journey/router.rb:30:in `each'
  actionpack (4.2.0.beta4) lib/action_dispatch/journey/router.rb:30:in `serve'
  actionpack (4.2.0.beta4) lib/action_dispatch/routing/route_set.rb:780:in `call'

I have an application to reproduce this problem called "ticketee" at https://github.com/railsbook/rails_4_in_action_examples/tree/bootstrap-wip. Start up the application and try navigating to any page. This error should appear in the console.

(P.S. Yes we are going to include Bootstrap in Rails 4 in Action.)

glebm referenced this issue in rubysherpas/r4ia_examples_old Nov 4, 2014
@glebm
Copy link
Member

glebm commented Nov 4, 2014

Was caused by the wrong extension: application.css instead of application.css.sass, rubysherpas/r4ia_examples_old#1 (comment)

@glebm glebm closed this as completed Nov 4, 2014
@radar
Copy link
Author

radar commented Nov 4, 2014

Well that's incredibly dumb of me. The 4 hours of tech reviewing must've turned my brain to mush. Thanks @glebm!

@glebm
Copy link
Member

glebm commented Nov 5, 2014

@radar Lots of users make this mistake, I think Rails is a bit weird for generating .css by default.

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

2 participants