Skip to content
Browse files

Handle a half-loaded rails module.

  • Loading branch information...
1 parent 7ec597b commit f94651d1a7a0972956d2fc11341ed78fb9cb938c @chriseppstein chriseppstein committed Feb 16, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/compass-rails.rb
View
3 lib/compass-rails.rb
@@ -12,7 +12,8 @@ module CompassRails
extend self
def load_rails
- return if defined?(::Rails) && !::Rails.application.nil?
+ return if defined?(::Rails) && ::Rails.respond_to?(:application) && !::Rails.application.nil?
+
rails_config_path = Dir.pwd
until File.exists?(File.join(rails_config_path, 'config', 'application.rb')) do
raise 'Rails application not found' if rails_config_path == '/'

0 comments on commit f94651d

Please sign in to comment.
Something went wrong with that request. Please try again.