복붙노트

[RUBY-ON-RAILS] 청사진 / screen.css은 미리 컴파일되지 않는다

RUBY-ON-RAILS

청사진 / screen.css은 미리 컴파일되지 않는다

나는 마이클 하틀의 우수한 RoR에 튜토리얼 그대로 따라했습니다,하지만 난 RoR에 3.1을 사용하고 있습니다. 나는 RoR에 3.1 초보자 및 자산 파이프 라인에 관한 도움이 필요 해요. 여기 내 문제가 있습니다 :

5.3 절을 계속하기 전에 내가 Heroku가에 밀어 일을 개발하는 방법을보고 싶은 생각했다. 놀랍게도 "GET /"오류 (500)의 결과는 모두 내 로컬 개발 - 환경에서 확인을했다. 나는 그 생산 환경 (레일의 -e 생산)에서 내 로컬 sample_app를 실행했습니다. 동일한 결과, 오류 500 :

Sprockets::Helpers::RailsHelper::AssetPaths::AssetNotPrecompiledError in Pages#home

Showing /Users/john/Projects/sample_app/app/views/layouts/_stylesheets.html.erb where line #4 raised:

blueprint/screen.css isn't precompiled

정보 지원 :

나는 무엇을 놓치고?

해결법

  1. ==============================

    1.http://guides.rubyonrails.org/asset_pipeline.html#precompiling-assets에서

    http://guides.rubyonrails.org/asset_pipeline.html#precompiling-assets에서

    이 방법 당신의 설정 / 환경 / production.rb, 당신 세트

    config.assets.precompile += %w( blueprint/screen.css blueprint/print.css )
    

    또는 캐치 올 :

    config.assets.precompile += %w( *.css *.js )
    
  2. ==============================

    2.내 application.css 파일의 청사진 스타일 시트에 대한 참조를 추가했다. 이 방법은, 내가 단순히 application.css 파일, 실행 레이크 자산을 수정해야하는 스타일 시트를 수정하는 레이아웃을 변경할 필요가 없습니다 : 사전 컴파일을하고, 웹 서버를 다시 시작 (경우에 WEBrick 또는 이와 유사한 것).

    내 application.css 파일의 청사진 스타일 시트에 대한 참조를 추가했다. 이 방법은, 내가 단순히 application.css 파일, 실행 레이크 자산을 수정해야하는 스타일 시트를 수정하는 레이아웃을 변경할 필요가 없습니다 : 사전 컴파일을하고, 웹 서버를 다시 시작 (경우에 WEBrick 또는 이와 유사한 것).

    내 application.css는 현재 다음과 같습니다 :

    /*
     * This is a manifest file that'll automatically include all the stylesheets available in this directory
     * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
     * the top of the compiled file, but it's generally better to create a new file per style scope.
     *= require_self
     *= require_tree ./blueprint
     *= require_tree . 
     */
    
  3. ==============================

    3.당신은 전술 한 바와 같이 생산에 자산을 미리 컴파일 할 수 있습니다. 그리고 당신은 카피 스트라 노를 사용하는 경우 코드 업데이트 후 그것을 할 수 있습니다 :

    당신은 전술 한 바와 같이 생산에 자산을 미리 컴파일 할 수 있습니다. 그리고 당신은 카피 스트라 노를 사용하는 경우 코드 업데이트 후 그것을 할 수 있습니다 :

    require 'bundler/capistrano'
    
    after 'deploy:update_code' do  
      run "cd #{release_path}; RAILS_ENV=#{rails_env} bundle exec rake assets:precompile"
    end
    
  4. ==============================

    4.나는 또한 마이클 하틀하여 우수한 RoR에 튜토리얼을 통해가는이 문제를 내 자신의 경험에서, 나는이 시점에서 생략 할 수있다 생각하는 하나의 단계가 있었다 ...

    나는 또한 마이클 하틀하여 우수한 RoR에 튜토리얼을 통해가는이 문제를 내 자신의 경험에서, 나는이 시점에서 생략 할 수있다 생각하는 하나의 단계가 있었다 ...

    bundle exec rake assets:precompile    
    git add public/assets
    git commit -m "vendor compiled assets"
    git push heroku
    

    내가 여기를 발견했다.

  5. from https://stackoverflow.com/questions/7443536/blueprint-screen-css-isnt-precompiled by cc-by-sa and MIT license