rails / sass-rails

Ruby on Rails stylesheet engine for Sass
MIT License
859 stars 333 forks source link

Failing tests under 1.9.2 with rvm #16

Closed pwnall closed 13 years ago

pwnall commented 13 years ago

I'm trying to get the tests to run. I tried on both Ubuntu 11.04 and OSX, using MRI 1.9.2-p180 installed with rvm. These tests are failing for me in both cases (trace included below). I did a vanilla checkout of the 3-1-stable branch, and then bundle install.

I've been trying to read out the code in sass-rails and sprockets, but I haven't been able to figure it out yet. Help would be awesome! I hope that, at the very least, README.markdown can be improved after figuring out the root issue.

Thank you!

pwnage:sass-rails victor$ bundle exec rake test
Loaded suite /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/rake_test_loader
Started
........E.E.....
Finished in 61.836125 seconds.

  1) Error:
test_sass_asset_paths_work(SassRailsTest):
NoMethodError: undefined method `assets' for nil:NilClass
  (in /Users/victor/workspace/sass-rails/test/fixtures/scss_project/app/assets/stylesheets/application.css.scss)
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/bundler/gems/rails-07ea84a03b2a/actionpack/lib/sprockets/helpers/rails_helper.rb:96:in `asset_environment'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/bundler/gems/rails-07ea84a03b2a/actionpack/lib/sprockets/helpers/rails_helper.rb:20:in `asset_paths'
    /Users/victor/workspace/sass-rails/test/support/sass_rails_test_case.rb:51:in `asset_paths_with_testing'
    /Users/victor/workspace/sass-rails/lib/sass/rails/template_handlers.rb:23:in `public_path'
    /Users/victor/workspace/sass-rails/lib/sass/rails/helpers.rb:26:in `public_path'
    /Users/victor/workspace/sass-rails/lib/sass/rails/helpers.rb:6:in `asset_path'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/script/funcall.rb:80:in `_perform'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/script/node.rb:40:in `perform'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/visitors/perform.rb:215:in `visit_prop'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/visitors/base.rb:37:in `visit'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/visitors/perform.rb:18:in `visit'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/visitors/base.rb:53:in `block in visit_children'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/visitors/base.rb:53:in `map'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/visitors/base.rb:53:in `visit_children'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/visitors/perform.rb:27:in `block in visit_children'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/visitors/perform.rb:39:in `with_environment'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/visitors/perform.rb:26:in `visit_children'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/visitors/base.rb:37:in `block in visit'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/visitors/perform.rb:230:in `visit_rule'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/visitors/base.rb:37:in `visit'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/visitors/perform.rb:18:in `visit'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/visitors/base.rb:53:in `block in visit_children'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/visitors/base.rb:53:in `map'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/visitors/base.rb:53:in `visit_children'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/visitors/perform.rb:27:in `block in visit_children'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/visitors/perform.rb:39:in `with_environment'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/visitors/perform.rb:26:in `visit_children'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/visitors/base.rb:37:in `block in visit'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/visitors/perform.rb:47:in `visit_root'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/visitors/base.rb:37:in `visit'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/visitors/perform.rb:18:in `visit'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/visitors/perform.rb:7:in `visit'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/root_node.rb:20:in `render'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/engine.rb:291:in `_render'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/engine.rb:238:in `render'
    /Users/victor/workspace/sass-rails/lib/sass/rails/template_handlers.rb:75:in `evaluate'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/tilt-1.3.2/lib/tilt/template.rb:76:in `render'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sprockets-2.0.0.beta.10/lib/sprockets/context.rb:107:in `block in evaluate'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sprockets-2.0.0.beta.10/lib/sprockets/context.rb:104:in `each'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sprockets-2.0.0.beta.10/lib/sprockets/context.rb:104:in `evaluate'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sprockets-2.0.0.beta.10/lib/sprockets/bundled_asset.rb:22:in `initialize'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sprockets-2.0.0.beta.10/lib/sprockets/environment_index.rb:118:in `new'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sprockets-2.0.0.beta.10/lib/sprockets/environment_index.rb:118:in `build_asset'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sprockets-2.0.0.beta.10/lib/sprockets/environment_index.rb:100:in `find_asset_in_path'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sprockets-2.0.0.beta.10/lib/sprockets/environment_index.rb:72:in `find_asset'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sprockets-2.0.0.beta.10/lib/sprockets/environment.rb:89:in `find_asset'
    /Users/victor/workspace/sass-rails/test/support/sass_rails_test_case.rb:62:in `sprockets_render'
    /Users/victor/workspace/sass-rails/test/sass_rails_test.rb:62:in `block in <class:SassRailsTest>'

  2) Error:
test_sass_imports_work_correctly(SassRailsTest):
NoMethodError: undefined method `assets' for nil:NilClass
  (in /Users/victor/workspace/sass-rails/test/fixtures/scss_project/app/assets/stylesheets/application.css.scss)
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/bundler/gems/rails-07ea84a03b2a/actionpack/lib/sprockets/helpers/rails_helper.rb:96:in `asset_environment'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/bundler/gems/rails-07ea84a03b2a/actionpack/lib/sprockets/helpers/rails_helper.rb:20:in `asset_paths'
    /Users/victor/workspace/sass-rails/test/support/sass_rails_test_case.rb:51:in `asset_paths_with_testing'
    /Users/victor/workspace/sass-rails/lib/sass/rails/template_handlers.rb:23:in `public_path'
    /Users/victor/workspace/sass-rails/lib/sass/rails/helpers.rb:26:in `public_path'
    /Users/victor/workspace/sass-rails/lib/sass/rails/helpers.rb:6:in `asset_path'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/script/funcall.rb:80:in `_perform'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/script/node.rb:40:in `perform'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/visitors/perform.rb:215:in `visit_prop'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/visitors/base.rb:37:in `visit'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/visitors/perform.rb:18:in `visit'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/visitors/base.rb:53:in `block in visit_children'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/visitors/base.rb:53:in `map'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/visitors/base.rb:53:in `visit_children'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/visitors/perform.rb:27:in `block in visit_children'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/visitors/perform.rb:39:in `with_environment'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/visitors/perform.rb:26:in `visit_children'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/visitors/base.rb:37:in `block in visit'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/visitors/perform.rb:230:in `visit_rule'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/visitors/base.rb:37:in `visit'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/visitors/perform.rb:18:in `visit'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/visitors/base.rb:53:in `block in visit_children'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/visitors/base.rb:53:in `map'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/visitors/base.rb:53:in `visit_children'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/visitors/perform.rb:27:in `block in visit_children'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/visitors/perform.rb:39:in `with_environment'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/visitors/perform.rb:26:in `visit_children'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/visitors/base.rb:37:in `block in visit'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/visitors/perform.rb:47:in `visit_root'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/visitors/base.rb:37:in `visit'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/visitors/perform.rb:18:in `visit'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/visitors/perform.rb:7:in `visit'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/tree/root_node.rb:20:in `render'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/engine.rb:291:in `_render'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.4/lib/sass/engine.rb:238:in `render'
    /Users/victor/workspace/sass-rails/lib/sass/rails/template_handlers.rb:75:in `evaluate'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/tilt-1.3.2/lib/tilt/template.rb:76:in `render'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sprockets-2.0.0.beta.10/lib/sprockets/context.rb:107:in `block in evaluate'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sprockets-2.0.0.beta.10/lib/sprockets/context.rb:104:in `each'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sprockets-2.0.0.beta.10/lib/sprockets/context.rb:104:in `evaluate'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sprockets-2.0.0.beta.10/lib/sprockets/bundled_asset.rb:22:in `initialize'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sprockets-2.0.0.beta.10/lib/sprockets/environment_index.rb:118:in `new'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sprockets-2.0.0.beta.10/lib/sprockets/environment_index.rb:118:in `build_asset'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sprockets-2.0.0.beta.10/lib/sprockets/environment_index.rb:100:in `find_asset_in_path'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sprockets-2.0.0.beta.10/lib/sprockets/environment_index.rb:72:in `find_asset'
    /Users/victor/.rvm/gems/ruby-1.9.2-p180/gems/sprockets-2.0.0.beta.10/lib/sprockets/environment.rb:89:in `find_asset'
    /Users/victor/workspace/sass-rails/test/support/sass_rails_test_case.rb:62:in `sprockets_render'
    /Users/victor/workspace/sass-rails/test/sass_rails_test.rb:48:in `block in <class:SassRailsTest>'

16 tests, 23 assertions, 0 failures, 2 errors, 0 skips

Test run options: --seed 21057
rake aborted!
Command failed with status (1): [/Users/victor/.rvm/rubies/ruby-1.9.2-p180/...]

Tasks: TOP => test
(See full trace by running task with --trace)
chriseppstein commented 13 years ago

Maybe rails changed :(

pwnall commented 13 years ago

I find it a bit weird that the main Gemfile requires edge rails, but the applications in test/fixtures require rails 3.1.rc4 in their Gemfiles. Is that on purpose?

I can try switching all Gemfiles to 3.1.rc4, and/or to edge. Would that be worthwhile, or am I missing a subtlety?

Thank you!

chriseppstein commented 13 years ago

I've updated the tests to keep the fixtures in sync with the current bundled environment when running tests. See: 428503d6b0ea9c3159e1a11dcc13b9b67c615ea5 and 77c6e73d44c25b119e6765d8f54657e620fb78a0