I recently wrote a blog post on the asset pipeline and learned that the folder lib/assets
should be included in the asset paths list. If I create a brand new Rails app using 3.2.2, run the console and then run the command y Rails.application.config.assets.paths
I don't see lib/assets. Shouldn't this be included by default?
Here's how I got there:
$ rails new example
$ cd example
$ rails c
>> y Rails.application.config.assets.paths
---
- /Users/eberry/Playground/example/app/assets/images
- /Users/eberry/Playground/example/app/assets/javascripts
- /Users/eberry/Playground/example/app/assets/stylesheets
- /Users/eberry/Playground/example/vendor/assets/javascripts
- /Users/eberry/Playground/example/vendor/assets/stylesheets
- /Users/eberry/.rvm/gems/ruby-1.9.2-p290/gems/jquery-rails-2.0.2/vendor/assets/javascripts
- /Users/eberry/.rvm/gems/ruby-1.9.2-p290/gems/coffee-rails-3.2.2/lib/assets/javascripts
=> nil
>>
Any help would be greatly appreciated.
I don't have Rails installed on this computer, but from the source reference it looks like lib/assets
would never be included, but any subpaths would.
Try creating lib/assets/javascripts
and see if that's included automatically.
Do you have anything in any of the lib folders? I have one js file in my lib/assets/javascripts folder and when I check my asset paths, only that one path, ie lib/assets/javascripts/, is displayed, though not lib/assets/images or lib/assets/stylesheets, since I did not create those folders.
I'm on Rails 3.2.3.
I had the same problem.
Put at least one file, for example in lib/assets/javascripts
, then restart your app.
Now rails c
, and Rails.application.config.assets.paths
should contain lib/assets/javascripts
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With