2012-10-01 3 views
0

Rails 3.0.3에서 3.2.8로 앱을 업그레이드하고 있습니다. 애셋을 미리 컴파일하려고합니다. 이 출력 결과는 다음과 같습니다.Rails 3.2.8 - 애셋을 사전 컴파일하지 못함

$ bundle exec rake assets:precompile 
/usr/local/rvm/rubies/ruby-1.9.2-p320/bin/ruby /usr/local/rvm/gems/[email protected]/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets 
rake aborted! 
no such file to load -- sass/rails/compressor 
    (in /home/danb/Documents/Projects/pier-admin/pier-admin/app/assets/stylesheets/application.css) 

Tasks: TOP => assets:precompile:primary 
(See full trace by running task with --trace) 
rake aborted! 
Command failed with status (1): [/usr/local/rvm/rubies/ruby-1.9.2-p320/bin/...] 

Tasks: TOP => assets:precompile 
(See full trace by running task with --trace) 

비교적 새로운이 문제의 원인은 무엇입니까? 이전에 자산을 사용하지 않고 있었으며 업 그레 이드 중에 최소한의 노력을 기울였습니다. 이 앱은 개발 중에 작동합니다. 어떤 도움을 주시면 감사하겠습니다.

자산 그룹은 다음과 같습니다 당신은 아마 그 보석을 놓치고 있도록 생산에 설치되지 않습니다 자산 군과 레이크 실패

group :assets do 
    gem 'sass' 
    gem 'coffee-script' 
    gem 'uglifier' 
end 

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 . 
*/ 

답변

1

있습니다.

하나의 옵션은 개발시 사전 컴파일하고/public에서 파일을 커밋 한 다음 프로덕션 서버로 밀어 넣는 것입니다.

또 다른 게으르게 application.rb 같은 자산을 초기화하는 것입니다

if defined?(Bundler) 
    # If you precompile assets before deploying to production, use this line 
    # Bundler.require(*Rails.groups(:assets => %w(development test))) 
    # If you want your assets lazily compiled in production, use this line 
    Bundler.require(:default, :assets, Rails.env) 
end 
+0

감사합니다, 케일! 그것은 물건을 깨끗하게했다. 나는 개발 환경에서 미리 컴파일하고 리포지토리에 푸시 한 다음 서버에 푸시했다. –

관련 문제