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

undefined method `environment' for nil:NilClass #3005

Closed
seanlinsley opened this issue Mar 15, 2014 · 7 comments
Closed

undefined method `environment' for nil:NilClass #3005

seanlinsley opened this issue Mar 15, 2014 · 7 comments

Comments

@seanlinsley
Copy link
Contributor

Failures:

  1) Stylesheets should successfully render the scss stylesheets using sprockets
     Failure/Error: assets.find_asset("active_admin.css")
     NoMethodError:
       undefined method `environment' for nil:NilClass
         (in /home/travis/build/gregbell/active_admin/spec/rails/rails-4.0.3/app/assets/stylesheets/active_admin.css.scss)
     # ./spec/integration/stylesheets_spec.rb:9:in `block (2 levels) in <top (required)>'
     # ./spec/integration/stylesheets_spec.rb:12:in `block (2 levels) in <top (required)>'

  2) Stylesheets should not have any syntax errors
     Failure/Error: assets.find_asset("active_admin.css")
     NoMethodError:
       undefined method `environment' for nil:NilClass
         (in /home/travis/build/gregbell/active_admin/spec/rails/rails-4.0.3/app/assets/stylesheets/active_admin.css.scss)
     # ./spec/integration/stylesheets_spec.rb:9:in `block (2 levels) in <top (required)>'
     # ./spec/integration/stylesheets_spec.rb:15:in `block (2 levels) in <top (required)>'

Finished in 2.63 seconds
11 examples, 2 failures

Failed examples:

rspec ./spec/integration/stylesheets_spec.rb:11 # Stylesheets should successfully render the scss stylesheets using sprockets
rspec ./spec/integration/stylesheets_spec.rb:14 # Stylesheets should not have any syntax errors
@seanlinsley
Copy link
Contributor Author

This is an issue with sass-rails and/or sprockets: rails/sass-rails#191, sstephenson/sprockets#537

@seanlinsley seanlinsley changed the title Rails 4 test failure on Travis undefined method `environment' for nil:NilClass Mar 17, 2014
seanlinsley added a commit that referenced this issue Mar 17, 2014
@tonycoco
Copy link

For now, just add this to your Gemfile...

gem "sass-rails", "4.0.2"

Or, until those issues referenced above get fixed.

@seanlinsley
Copy link
Contributor Author

@tonycoco this has been fixed on master: 04aef93

@tonycoco
Copy link

@seanlinsley, the problem is not in sprockets. ActiveAdmin should probably lock sass-rails and not sprockets, for now. See @josh's (sprockets maintainer) comments...

"This is a sass-rails issue. It monkey patches private Sprockets classes. The fix will need to be made there."

Though, locking sprockets fixes the problem, we should probably just lock sass-rails and leave sprockets alone...

gem "sass-rails", "4.0.2"

Anyone else have any more information on the topic?

@josh
Copy link

josh commented Mar 20, 2014

@tonycoco sound advice.

@cookrn
Copy link

cookrn commented Apr 28, 2014

Was having this issue today. To fix, I locked:

gem 'rails', '4.0.4'
gem 'sass-rails', '~> 4.0.3'
gem 'bourbon', '< 4'
gem 'activeadmin', :github => 'gregbell/active_admin'

Please let me know if I can provide additional information.

seanlinsley added a commit that referenced this issue May 21, 2014
…though we have to specify a version for sass-rails (#3093)
@seanlinsley
Copy link
Contributor Author

This looks to be resolved now 🐝

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

4 participants