title: Unable to load Sass / Compass after installing RVM, to use with Assetic in Symfony2
body: <p>I was trying to use Capifony, which requires Capistrano, which requires Ruby. But my apt version of ruby was old and was throwing syntax errors. So then I installed RVM and did this:</p>
  
  <pre><code>$ rvm use 1.9.3
  $ rvm --rvmrc --create use 1.9.3@myapp
  $ gem install sass [--pre]
  $ gem install compass [--pre]
  $ updatedb
  $ locate sass | grep myapp | grep bin
  $ locate compass | grep myapp | grep bin
  </code></pre>
  
  <p>Copied and pasted those paths to config.yml</p>
  
  <pre><code>    sass:
          bin: /usr/local/rvm/gems/ruby-1.9.3-p194@myapp/gems/sass-3.2.0.alpha.277/bin/sass
          #apply_to: "\.scss$"
      compass:
          bin: /usr/local/rvm/gems/ruby-1.9.3-p194@myapp/gems/compass-0.13.alpha.0/bin/compass
          apply_to: "\.scss$"
  </code></pre>
  
  <p>Everything about Compass and Sass worked fine before switching to RVM.
  Compass/Sass still seem to work from app_dev.php, but they break when I try to dump assets for production:</p>
  
  <pre><code>$ rm -r app/cache/ # this is how I delete cache, any other way give me errors, even before having this compass problem. This have always worked fine. I removed the * because this code block was interpreting it as a comment
  $ php app/console assetic:dump --env=prod --no-debug
  Dumping all prod assets.
  Debug mode is off.
  
  00:05:36 [file+] /home/www/dev/public/myapp/app/../web/css/fcd6640.css
  
  
  
    [Assetic\Exception\FilterException]                                                                                                                  
    An error occurred while running:                                                                                                                     
    '/usr/local/rvm/rubies/ruby-1.9.3-p194/bin/ruby' '/usr/local/rvm/gems/ruby-1.9.3-p194@myapp/gems/compass-0.13.alpha.0/bin/compass' 'compile' '/t  
    mp' '--config' '/tmp/assetic_compassF1Mv7t' '--sass-dir' '' '--css-dir' '' '/tmp/assetic_compassKDoaEA.scss'                                         
  
    Error Output:                                                                                                                                        
    /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- sass (LoadError  
    )                                                                                                                                                    
      from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'                                      
      from /usr/local/rvm/gems/ruby-1.9.3-p194@myapp/gems/compass-0.13.alpha.0/lib/compass/dependencies.rb:6:in `rescue in &lt;top (required)&gt;'           
      from /usr/local/rvm/gems/ruby-1.9.3-p194@myapp/gems/compass-0.13.alpha.0/lib/compass/dependencies.rb:1:in `&lt;top (required)&gt;'                     
      from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'                                      
      from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'                                      
      from /usr/local/rvm/gems/ruby-1.9.3-p194@myapp/gems/compass-0.13.alpha.0/lib/compass.rb:5:in `block in &lt;top (required)&gt;'                         
      from /usr/local/rvm/gems/ruby-1.9.3-p194@myapp/gems/compass-0.13.alpha.0/lib/compass.rb:4:in `each'                                              
      from /usr/local/rvm/gems/ruby-1.9.3-p194@myapp/gems/compass-0.13.alpha.0/lib/compass.rb:4:in `&lt;top (required)&gt;'                                  
      from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'                                      
      from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'                                      
      from /usr/local/rvm/gems/ruby-1.9.3-p194@myapp/gems/compass-0.13.alpha.0/bin/compass:20:in `block in &lt;main&gt;'                                     
      from /usr/local/rvm/gems/ruby-1.9.3-p194@myapp/gems/compass-0.13.alpha.0/bin/compass:8:in `fallback_load_path'                                   
      from /usr/local/rvm/gems/ruby-1.9.3-p194@myapp/gems/compass-0.13.alpha.0/bin/compass:19:in `&lt;main&gt;'                                              
  
  
    Output:                                                                                                                                              
    Unable to load Sass. Please install it with one of the following commands:                                                                           
      gem install sass --pre                                                                                                                             
  
  
    Input:                                                                                                                                               
    $main-color: red;                                                                                                                                    
  
    body {                                                                                                                                               
      color: $main-color;                                                                                                                                 
    } 
  </code></pre>
  
  <p>Another error I have been getting:</p>
  
  <pre><code>Error Output:                                                                                                                                        
  /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find compass (&gt;= 0) amongst [big decimal-1.1.0, io-console-0.3, json-1.5.4, minitest-2.5.1, rake-0.9.2.2, rdoc-3.9.4] (Gem::LoadError)
  </code></pre>
  
  <p>Related: @mpapis @jamz <a href="https://stackoverflow.com/questions/8979956/sass-broken-after-install-with-rvm-using-assetic-php">Sass broken after install with RVM, using Assetic PHP</a></p>
  
  <p>I would like to add more tags: compass and sass. Not sure if can be done with higher score.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I added a wrapper like this:</p>
  
  <pre><code>$ rvm wrapper ruby-1.9.3-p194@myapp php sass compass
  </code></pre>
  
  <p>And edited config.yml again, but now I get these errors alternated, randomly:</p>
  
  <p>Error 1:</p>
  
  <pre><code>[Assetic\Exception\FilterException]                                                                                                                  
    An error occurred while running: '/usr/local/rvm/rubies/ruby-1.9.3-p194/bin/ruby' '/usr/local/rvm/bin/php_compass' 'compile' '/tmp' '--config' '/tmp/assetic_compass0Tmn8t' '--sass- dir' '' '--css-dir' '' '/tmp/assetic_compasssw2S3k.scss'                                                                                             
  
    Error Output: /usr/local/rvm/rubies/ruby-1.9.3-p194/bin/ruby: no Ruby script found in input (LoadError)                                              
  Input:                                                                                                                                               
    $main-color: red;                                                                                                                                    
  
    body     {                                                                                                                                               
      color: $main-color;                                                                                                                                 
    } 
  </code></pre>
  
  <p>Error 2:</p>
  
  <pre><code>Error Output: /usr/local/rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler/shared_helpers.rb:22:in `default_gemfile': Could not locate Gemfile (Bundler::GemfileNotFound)                                                                                                                                
  from /usr/local/rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler.rb:213:in `default_gemfile' 
  </code></pre>
  
  <p>Compass still works fine through app_dev.php</p>