Bunyamin Inan
Bunyamin Inan

Reputation: 175

Sprockets cannot file an asset even though it exists in the rails application

I have a really interesting problem with sprockets. First of all, this is the following error message I have got.

couldn't find file 'jquery.themepunch.plugins.min' with type 'application/javascript'
Checked in these paths: 

enter image description here

Here is the interesting part. It says a javascript plugin cannot be found, but the problem is caused in the line 13, which has a stylesheet_link_tag. How could it be possible?

Anyway, I have frontend.js and frontend.css files. Here is the content of files.

frontend.css

/*
 *= require css/style
 *= require css/colors/red
 *= require_self
 */

frontend.js

// require scripts/jquery.themepunch.plugins.min
// require scripts/jquery.themepunch.revolution.min
// require scripts/jquery.themepunch.showbizpro.min
// require scripts/jquery.easing.min
// require scripts/jquery.tooltips.min
// require scripts/jquery.magnific-popup.min
// require scripts/jquery.superfish
// require scripts/jquery.flexslider
// require scripts/jquery.jpanelmenu
// require scripts/jquery.isotope.min
// require scripts/custom

I purposely changed //= to // in order to cancel the inclution of javascript plugins.

EDIT 1: Here is my assets paths:

[1] pry(main)> Rails.application.config.assets.paths
=> ["/ssd/Projects/my_app/app/assets/fonts",
 "/ssd/Projects/my_app/app/assets/images",
 "/ssd/Projects/my_app/app/assets/javascripts",
 "/ssd/Projects/my_app/app/assets/stylesheets",
 "/ssd/Projects/my_app/vendor/assets/astrum",
 "/ssd/Projects/my_app/vendor/assets/javascripts",
 "/ssd/Projects/my_app/vendor/assets/metronic_v4.7.5",
 "/ssd/Projects/my_app/vendor/assets/stylesheets",
 "/home/bunyamin/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/font-kit-rails-1.2.0/app/assets/fonts",
 "/home/bunyamin/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/font-kit-rails-1.2.0/app/assets/stylesheets",
 "/home/bunyamin/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/jquery-rails-4.3.1/vendor/assets/javascripts",
 "/home/bunyamin/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/coffee-rails-4.1.1/lib/assets/javascripts",
 "/ssd/Projects/my_app/vendor/assets/astrum"]

I am really stuck. How can I solve this problem? Would anyone please help? I am not requiring any javascript plugins as you can see, yet I get file not found error.

Upvotes: 1

Views: 714

Answers (1)

Bunyamin Inan
Bunyamin Inan

Reputation: 175

Sprockets really does not give a useful error message. I have forgot an application.js file in one of assets folder. And it automatically runs it, even though I am not calling.

Then it shows error message as if the stylesheet file is the cause.

Anyway, after removing application.js my problem is solved.

Upvotes: 1

Related Questions