Compass/compass-rails — Issue #2: Note about existing configuration files
Author: rickharris
Created: 2012-02-01 02:09:34+00:00
State: open

I had a little hiccup in updating an existing Rails project. I was following the update instructions that says "First and foremost, follow the installation instructions above." I think this could be clearer.

The installation instructions say to execute

```
$ bundle exec compass init
```

That was a little deceiving to me because I already had a compass config file that was causing anything from `bundle exec compass` to fail with a big stack trace, shown here

```
$ bundle exec compass init
./config/compass.rb:4:in `get_binding': uninitialized constant Compass::AppIntegration::Rails (NameError)
from /Users/rick/.rubies/1.9.3-p0/lib/ruby/gems/1.9.1/gems/compass-0.12.rc.0/lib/compass/configuration/serialization.rb:24:in `eval'
from /Users/rick/.rubies/1.9.3-p0/lib/ruby/gems/1.9.1/gems/compass-0.12.rc.0/lib/compass/configuration/serialization.rb:24:in `parse_string'
from /Users/rick/.rubies/1.9.3-p0/lib/ruby/gems/1.9.1/gems/compass-0.12.rc.0/lib/compass/configuration/serialization.rb:15:in `block in _parse'
from /Users/rick/.rubies/1.9.3-p0/lib/ruby/gems/1.9.1/gems/compass-0.12.rc.0/lib/compass/configuration/serialization.rb:14:in `open'
from /Users/rick/.rubies/1.9.3-p0/lib/ruby/gems/1.9.1/gems/compass-0.12.rc.0/lib/compass/configuration/serialization.rb:14:in `_parse'
from /Users/rick/.rubies/1.9.3-p0/lib/ruby/gems/1.9.1/gems/compass-0.12.rc.0/lib/compass/configuration/file_data.rb:7:in `block in new_from_file'
from /Users/rick/.rubies/1.9.3-p0/lib/ruby/gems/1.9.1/gems/compass-0.12.rc.0/lib/compass/configuration/inheritance.rb:204:in `with_defaults'
from /Users/rick/.rubies/1.9.3-p0/lib/ruby/gems/1.9.1/gems/compass-0.12.rc.0/lib/compass/configuration/file_data.rb:6:in `new_from_file'
from /Users/rick/.rubies/1.9.3-p0/lib/ruby/gems/1.9.1/gems/compass-0.12.rc.0/lib/compass/configuration/helpers.rb:42:in `configuration_for'
from /Users/rick/.rubies/1.9.3-p0/lib/ruby/gems/1.9.1/gems/compass-rails-1.0.0.rc.1/lib/compass-rails.rb:183:in `boot_config'
from /Users/rick/.rubies/1.9.3-p0/lib/ruby/gems/1.9.1/gems/compass-rails-1.0.0.rc.1/lib/compass-rails.rb:201:in `'
from /Users/rick/.rubies/1.9.3-p0/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in `require'
from /Users/rick/.rubies/1.9.3-p0/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from /Users/rick/.rubies/1.9.3-p0/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in `each'
from /Users/rick/.rubies/1.9.3-p0/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in `block in require'
from /Users/rick/.rubies/1.9.3-p0/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in `each'
from /Users/rick/.rubies/1.9.3-p0/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in `require'
from /Users/rick/.rubies/1.9.3-p0/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler.rb:122:in `require'
from /Users/rick/.rubies/1.9.3-p0/lib/ruby/gems/1.9.1/gems/compass-0.12.rc.0/bin/compass:25:in `'
from /Users/rick/.rubies/1.9.3-p0/lib/ruby/gems/1.9.1/bin/compass:19:in `load'
from /Users/rick/.rubies/1.9.3-p0/lib/ruby/gems/1.9.1/bin/compass:19:in `

'
```

It was being caused by these two lines in my existing compass config:

```ruby
project_path = Compass::AppIntegration::Rails.root
environment = Compass::AppIntegration::Rails.env
```

I think it would be more helpful for people upgrading to explain in the "Upgrade" section of the README that the previous configuration options aren't all needed, and they can replace most of it with just

```ruby
# Require any additional compass plugins here.
project_type = :rails
```

Other than that, compass-rails = so easy. So much better. Thank you.