Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

print asset:precompile --trace output if can't detect rake task

  • Loading branch information...
commit 8bbf5932802e1e21f24ff6925203e63cf76daf0d 1 parent 56c6f6d
Terence Lee authored July 20, 2012

Showing 1 changed file with 11 additions and 0 deletions. Show diff stats Hide diff stats

  1. 11  lib/language_pack/rails3.rb
11  lib/language_pack/rails3.rb
@@ -61,10 +61,21 @@ def run_assets_precompile_rake_task
61 61
             puts "http://devcenter.heroku.com/articles/rails31_heroku_cedar#troubleshooting"
62 62
           end
63 63
         end
  64
+      else
  65
+        if asset_pipeline_rails?
  66
+          puts " ! Error running/detecting assets:precompiling task. Rerunning with --trace"
  67
+          pipe("env PATH=$PATH:bin bundle exec rake assets:precompile --trace 2>&1")
  68
+        end
64 69
       end
65 70
     end
66 71
   end
67 72
 
  73
+  # detects if the rails we're using has the asset pipeline
  74
+  # @return [Bundler::LazySpecification] the matching gempsec for rails if true and nil if it isn't compatible
  75
+  def asset_pipeline_rails?
  76
+    lockfile_parser.specs.detect {|spec| spec.name == "rails" && spec.version >= Gem::Version.new("3.1.0") }
  77
+  end
  78
+
68 79
   # setup the database url as an environment variable
69 80
   def setup_database_url_env
70 81
     ENV["DATABASE_URL"] ||= begin

0 notes on commit 8bbf593

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