1

Heroku 배포 (Rails 3.2.3)에서 asset_sync gem을 사용하고 있습니다. 사전 컴파일은 로컬에서 훌륭하게 작동하지만 (문제없이 내 AWS 버킷까지 자산을 푸시) Heroku에 푸시하면 애셋 미리 컴파일하는 동안 중단됩니다.asset_sync Gem은 사전 컴파일시 Heroku를 정지시킵니다.

Preparing app for Rails asset pipeline 
Running: rake assets:precompile 
AssetSync: using default configuration from built-in initializer 

그럼 결국은 시간 초과없이 explaination와 :

/app/slug-compiler/lib/utils.rb:66:in `block (2 levels) in spawn': command='/app/slug-compiler/lib/../../tmp/buildpacks/ruby/bin/compile /tmp/build_33de6far26atq /app/tmp/repo.git/.cache' exit_status=0 out='' at=timeout elapsed=900.1074194908142 (Utils::TimeoutError) 
    from /app/slug-compiler/lib/utils.rb:52:in `loop' 
    from /app/slug-compiler/lib/utils.rb:52:in `block in spawn' 
    from /app/slug-compiler/lib/utils.rb:47:in `popen' 
    from /app/slug-compiler/lib/utils.rb:47:in `spawn' 
    from /app/slug-compiler/lib/buildpack.rb:38:in `block in compile' 
    from /app/slug-compiler/lib/buildpack.rb:36:in `fork' 
    from /app/slug-compiler/lib/buildpack.rb:36:in `compile' 
    from /app/slug-compiler/lib/slug.rb:487:in `block in run_buildpack' 
    from /app/slug-compiler/lib/utils.rb:121:in `log' 
    from /app/slug-compiler/lib/slug.rb:743:in `log' 
    from /app/slug-compiler/lib/slug.rb:486:in `run_buildpack' 
    from /app/slug-compiler/lib/slug.rb:116:in `block (2 levels) in compile' 
    from /app/slug-compiler/lib/utils.rb:102:in `block in timeout' 
    from /usr/local/lib/ruby/1.9.1/timeout.rb:58:in `timeout' 
    from /app/slug-compiler/lib/utils.rb:102:in `rescue in timeout' 
    from /app/slug-compiler/lib/utils.rb:97:in `timeout' 
    from /app/slug-compiler/lib/slug.rb:104:in `block in compile' 
    from /app/slug-compiler/lib/utils.rb:121:in `log' 
    from /app/slug-compiler/lib/slug.rb:743:in `log' 
    from /app/slug-compiler/lib/slug.rb:103:in `compile' 
    from /app/slug-compiler/bin/slugc:85:in `block in <main>' 
    from /app/slug-compiler/lib/slug.rb:495:in `block in lock' 
    from /app/slug-compiler/lib/repo_lock.rb:44:in `call' 
    from /app/slug-compiler/lib/repo_lock.rb:44:in `run' 
    from /app/slug-compiler/lib/slug.rb:495:in `lock' 
    from /app/slug-compiler/bin/slugc:66:in `<main>' 
!  Heroku push rejected, failed to compile Ruby/rails app 

$ heroku config 내가 다시하고 다시 검사 한 다음 ENVs를 설정했는지 보여줍니다. 나는 그들이 작동하기 때문에 로컬 사전 컴파일 할 때 올바른 값을 알고 :

AWS_ACCESS_KEY_ID:   XXXX 
AWS_SECRET_ACCESS_KEY:  XXXX 
FOG_DIRECTORY:    XXXX 
FOG_PROVIDER:    AWS 
FOG_REGION:     eu-west-1 

내 공공/자산 폴더에서 확인하지 않아도, 나는 내 production.rb에서 다음과 같은 설정이 있습니다

# Disable Rails's static asset server (Apache or nginx will already do this) 
    config.serve_static_assets = false 

    # Compress JavaScripts and CSS 
    config.assets.compress = true 

    # Don't fallback to assets pipeline if a precompiled asset is missed (This would involve live compilation and a big performance issue) 
    config.assets.compile = false 

    # Generate digests for assets URLs (Fingerprinting) 
    config.assets.digest = true 

    # (Heroku requires that this be false) 
    config.assets.initialize_on_precompile = false 

    # AWS Bucket 
    config.action_controller.asset_host = "http://#{ENV['FOG_DIRECTORY']}.s3.amazonaws.com" 

나는 asset_sync의 README에서 언급에게 Heroku에 다음과 같은 설정 : 이러한 문제의 원인이 될 수 있습니다 및/또는 어떻게 더를 디버깅 할 수 있습니다 무엇

$heroku labs:enable user-env-compile -a myapp 

. 나는 왜 사전 컴파일이 Heroku에 매달려 있는지에 대한 정보를 얻는 방법을 볼 수 없다.

답변

1

Sass 컴파일러의 문제였습니다. 그것은 어떤 종류의 오류도 던지지 않고 무언가에 질식했습니다. 나는 그걸 막을 때까지 기다렸다가, 그 다음에 프로세스를 종료하면서, here의 단계를 사용하여 좀 더 많은 정보를 얻을 수 있었다. 그게 나에게 깔끔한 파서에게 스택 트레이스를 주었다. 그것이 어떤 종류의 순환 의존성이라고 생각하십시오.

관련 문제