undefined method `environment’ for nil:NilClass when importing Bootstrap

I ran in to this problem as well and it looks like an issue related to the latest version of sprockets and you can fix it as suggested by changing the Gemfile.lock, but if someone or something does a bundle update it’s going to get broken again and I know some places don’t like to check in Gemfile.lock until there’s a push to stage.

If you use sass-rails better than 4.0.0 it will resolve the problem…

gem 'sass-rails', '~> 4.0.0'

The problem is solved and it will limit sprockets to 2.11. From the generated Gemfile.lock…

    sass-rails (4.0.2)
      railties (>= 4.0.0, < 5.0)
      sass (~> 3.2.0)
      sprockets (~> 2.8, <= 2.11.0)
      sprockets-rails (~> 2.0.0)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)