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

Sprockets DependencyError #49

Closed
adamyonk opened this issue Apr 18, 2014 · 7 comments
Closed

Sprockets DependencyError #49

adamyonk opened this issue Apr 18, 2014 · 7 comments

Comments

@adamyonk
Copy link

I get the following error when I try to @import peek in my application.css.sass. Rails 4.1.

Sprockets::Rails::Helper::DependencyError at /
Asset depends on 'peek/bar/production.gif' to generate properly but has not declared the dependency
Please add: //= depend_on_asset "peek/bar/production.gif" to '/app/assets/stylesheets/application.css.sass'

@adamyonk
Copy link
Author

Also, I'm using jQuery 2.1.0 and rails_behaviors (instead of jquery_ujs).

@adamyonk
Copy link
Author

I also tried putting the peek stylesheets in their own manifest and used Sprockets //=require, but it seems like the main peek stylesheet is missing.

The gem is setting my config.assets.paths correctly, though:

[4] pry(main)> Rails.application.config.assets.paths
[
  [ 0] "/Users/adamyonk/.code/spaces@librato/app/assets/images",
  [ 1] "/Users/adamyonk/.code/spaces@librato/app/assets/javascripts",
  [ 2] "/Users/adamyonk/.code/spaces@librato/app/assets/stylesheets",
  [ 3] "/Users/adamyonk/.code/spaces@librato/vendor/assets/bower_components",
  [ 4] "/Users/adamyonk/.code/spaces@librato/vendor/assets/fonts",
  [ 5] "/Users/adamyonk/.code/spaces@librato/vendor/assets/javascripts",
  [ 6] "/Users/adamyonk/.code/spaces@librato/vendor/assets/stylesheets",
  [ 7] "/Users/adamyonk/.gem/ruby/2.1.1/gems/peek-performance_bar-1.1.3/app/assets/javascripts",
  [ 8] "/Users/adamyonk/.gem/ruby/2.1.1/gems/peek-performance_bar-1.1.3/app/assets/stylesheets",
  [ 9] "/Users/adamyonk/.gem/ruby/2.1.1/gems/peek-0.1.8/app/assets/images",
  [10] "/Users/adamyonk/.gem/ruby/2.1.1/gems/peek-0.1.8/app/assets/javascripts",
  [11] "/Users/adamyonk/.gem/ruby/2.1.1/gems/peek-0.1.8/app/assets/stylesheets",
  [12] "/Users/adamyonk/.gem/ruby/2.1.1/gems/coffee-rails-4.0.1/lib/assets/javascripts",
  [13] "/Users/adamyonk/.code/spaces@librato/vendor/assets/bower_components"
]

@dewski
Copy link
Member

dewski commented Apr 18, 2014

I also tried putting the peek stylesheets in their own manifest and used Sprockets //=require, but it seems like the main peek stylesheet is missing.

Looks like it's correctly in your load path:

"/Users/adamyonk/.gem/ruby/2.1.1/gems/peek-0.1.8/app/assets/stylesheets"

I get the following error when I try to @import peek in my application.css.sass. Rails 4.1.

Sprockets::Rails::Helper::DependencyError at /
Asset depends on 'peek/bar/production.gif' to generate properly but has not declared the dependency
Please add: //= depend_on_asset "peek/bar/production.gif" to '/app/assets/stylesheets/application.css.sass'

I tried this out locally and it worked on my machine. Is there any way you can create a reproducible example? rails/sprockets-rails#126 may have fixed it.

➜  peeked  rake assets:precompile
Warning: You're using Rubygems 2.0.3 with Spring. Upgrade to at least Rubygems 2.1.0 and run `gem pristine --all` for better startup performance.
I, [2014-04-18T13:05:05.416877 #77392]  INFO -- : Writing /Users/dewski/peeked/public/assets/application-f3a3d0cd7d7e10b8c1731668fb3ac028.js
I, [2014-04-18T13:05:05.477444 #77392]  INFO -- : Writing /Users/dewski/peeked/public/assets/application-318ad46b68d0e219760c7f78b82e46b4.css
I, [2014-04-18T13:05:05.478995 #77392]  INFO -- : Writing /Users/dewski/peeked/public/assets/peek/bar/development-f50c77dcf395165a2684474ac7c8a486.gif
I, [2014-04-18T13:05:05.480112 #77392]  INFO -- : Writing /Users/dewski/peeked/public/assets/peek/bar/production-43f9ef465f79fb9dd02a2ccd2be0dac4.gif
I, [2014-04-18T13:05:05.480957 #77392]  INFO -- : Writing /Users/dewski/peeked/public/assets/peek/bar/staging-9058522f4ce931745297ce6a5deb879f.gif
➜  peeked  bundle list
Gems included by the bundle:
  * actionmailer (4.1.0)
  * actionpack (4.1.0)
  * actionview (4.1.0)
  * activemodel (4.1.0)
  * activerecord (4.1.0)
  * activesupport (4.1.0)
  * arel (5.0.1.20140414130214)
  * atomic (1.1.16)
  * builder (3.2.2)
  * bundler (1.5.1)
  * coffee-rails (4.0.1)
  * coffee-script (2.2.0)
  * coffee-script-source (1.7.0)
  * erubis (2.7.0)
  * execjs (2.0.2)
  * hike (1.2.3)
  * i18n (0.6.9)
  * jbuilder (2.0.6)
  * jquery-rails (3.1.0)
  * json (1.8.1)
  * mail (2.5.4)
  * mime-types (1.25.1)
  * minitest (5.3.3)
  * multi_json (1.9.2)
  * peek (0.1.8)
  * polyglot (0.3.4)
  * rack (1.5.2)
  * rack-test (0.6.2)
  * rails (4.1.0)
  * railties (4.1.0)
  * rake (10.3.1)
  * rdoc (4.1.1)
  * sass (3.2.19)
  * sass-rails (4.0.3)
  * sdoc (0.4.0)
  * spring (1.1.2)
  * sprockets (2.11.0)
  * sprockets-rails (2.1.3)
  * sqlite3 (1.3.9)
  * thor (0.19.1)
  * thread_safe (0.3.3)
  * tilt (1.4.1)
  * treetop (1.4.15)
  * turbolinks (2.2.2)
  * tzinfo (1.1.0)
  * uglifier (2.5.0)

@adamyonk
Copy link
Author

This is so strange. No errors on rake assets:precompile. I'm also using the peek-performance_bar and it compiles fine: screenshot 2014-04-18 15 31 51
But peek.css just compiles to a blank file.
screenshot 2014-04-18 15 32 06

Interestingly, if I @import peek or //=require peek, there are no errors, but if I try to @import peek.scss or //=require peek.scss I get the error about needing to add //= depend_on_asset "peek/bar/production.gif".

@adamyonk
Copy link
Author

If I go into the gem and rename peek.scss to peek-main.scss and @include peek-main, then it works. It seems like Sprockets is getting confused with having both /stylesheets/peek.scss and /stylesheets/peek/ ?

@adamyonk
Copy link
Author

Gosh, now it's only happening sometimes. I'll keep debugging and re-open this if I think it has to do with peek. Sorry, for the trouble.

@dewski
Copy link
Member

dewski commented Apr 18, 2014

Gosh, now it's only happening sometimes. I'll keep debugging and re-open this if I think it has to do with peek. Sorry, for the trouble.

No worries! Please do re-open if it happens again.

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