Skip to content
New issue

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

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

Already on GitHub? # to your account

[Rails 4.1] Sprockets error shows undeclared dependency #20

Closed
DanielKehoe opened this issue Apr 10, 2014 · 7 comments
Closed

[Rails 4.1] Sprockets error shows undeclared dependency #20

DanielKehoe opened this issue Apr 10, 2014 · 7 comments

Comments

@DanielKehoe
Copy link
Member

When using Bootstrap with Rails 4.1.0, when visiting any page of the rails-bootstrap example app, I get this error:

Sprockets::Rails::Helper::DependencyError at /
Asset depends on 'bootstrap/glyphicons-halflings-regular.eot' to generate properly but has not declared the dependency
Please add: `//= depend_on_asset "bootstrap/glyphicons-halflings-regular.eot"` to '/Users/danielkehoe/workspace/wip/rails-devise-pundit/app/assets/stylesheets/framework_and_overrides.css.scss'

This is because sanity checks from the sprockets_better_errors gem have been merged into Rails 4.1. The intent is to reveal asset pipeline errors that you would see in production when you run the app in development mode. See rails/sprockets-rails#96

To resolve this, the rails_layout gem should update the framework_and_overrides.css.scss file to include:

//= depend_on_asset "bootstrap/glyphicons-halflings-regular.eot"
//= depend_on_asset "bootstrap/glyphicons-halflings-regular.svg"
//= depend_on_asset "bootstrap/glyphicons-halflings-regular.ttf"
//= depend_on_asset "bootstrap/glyphicons-halflings-regular.woff"

See RailsApps/rails-bootstrap#17

@DanielKehoe
Copy link
Member Author

Looks like this was fixed in the bootstrap-sass gem:
twbs/bootstrap-sass@8bc2fca

See twbs/bootstrap-sass#578

Let's add a temporary fix to the rails_layout gem pending release of the next version of the bootstrap-sass gem. Otherwise I'll have to tell everyone to use the master version of the bootstrap-sass gem which means updating documentation everywhere, twice.

@dustinbrownman
Copy link

Thank you for this workaround. This is what happens when I jump too excitedly into a new version of Rails :)
Quick question, I'm having trouble locating the framework_and_overrides.css.scss file to update? This is definitely my lack of understanding. Any chance someone can point me in the right direction? Thanks!!

@DanielKehoe
Copy link
Member Author

You're looking for app/assets/stylesheets/framework_and_overrides.css.scss.

The RailsApps tutorial has all the details:
http://railsapps.github.io/twitter-bootstrap-rails.html

You can use the new release of the rails_layout gem to fix things. Do a bundle update to get the new release. Then run

$ rails generate layout:install bootstrap3

@dustinbrownman
Copy link

Ah, that makes much more sense. Thank you so much!

On Thu, Apr 10, 2014 at 11:10 AM, Daniel Kehoe notifications@github.com
wrote:

You're looking for app/assets/stylesheets/framework_and_overrides.css.scss.
The RailsApps tutorial has all the details:
http://railsapps.github.io/twitter-bootstrap-rails.html
You can use the new release of the rails_layout gem to fix things. Do a bundle update to get the new release. Then run

$ rails generate layout:install bootstrap3

Reply to this email directly or view it on GitHub:
#20 (comment)

@colivieri
Copy link

Thanks for the work around!

@mecampbellsoup
Copy link

@DanielKehoe Sorry, I believe this is a related question but... as of Rails 4.1, is the sprockets_better_errors gem no longer necessary based on your comment here?

@DanielKehoe
Copy link
Member Author

@mecampbellsoup Yes, that's right.

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

No branches or pull requests

4 participants