opened
rickpr
username_0
`uname -a`
```
Linux centaurus 3.10.0-123.20.1.el7.x86_64 #1 SMP Thu Jan 29 18:05:33 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
```
OS: CentOS Linux release 7.0.1406 (Core)

This also is present on Fedora 21, and Ubuntu 14.04.

# Steps to reproduce:

Make a new Rails application:
```
rails new my_app
```

Add Twitter Bootstrap and Less Rails to the application (also uncomment `therubyracer`):
``` ruby
gem 'therubyracer'
gem 'twitter-bootstrap-rails'
gem 'less-rails'
```

Install Bootstrap Less using the preconfigured generators:
```
rails g bootstrap install:less
rails g bootstrap layout
```

Now, try to compile assets
```
rake assets:precompile
```
Errors:
```
NoMethodError: undefined method `[]' for nil:NilClass
/home/fdisk/.rvm/gems/ruby-2.2.1/gems/less-rails-2.6.0/lib/less/rails/template_handlers.rb:37:in `config_paths'
```

# Workaround
This is because the `env.context_class.less_config` is set to `nil` by Sprockets. The `less-rails` Railtie makes this config variable, and I also tried writing an initializer but this gets destroyed when put into `Sprockets::CachedEnvironment`. Edit `~/.rvm/gems/ruby-2.2.1/gems/sprockets-3.0.1/lib/rake/sprocketstask.rb` and on line 147, add the following:
``` ruby
env.context_class.less_config = app.config.less
```

You may now precompile assets.

I will try to find out why this variable gets lost. Currently I can't figure out how this is called.
Can't use with Twitter Bootstrap Rails or Less Rails (with hacky workaround)
issue
created
josh
username_1
I think the less railtie should probably be wrapping its access in an `config.assets.configure` block rather than an initializer here https://github.com/metaskills/less-rails/blob/master/lib/less/rails/railtie.rb#L21-L27
comment
closed
josh
username_1
issue