heroku部署,预编译资产失败

时间:2015-03-09 09:56:35

标签: ruby-on-rails heroku

我不知道如何解决它......

当我在终端中部署heroku时,我的错误代码..

预编制资产失败..

我添加了config.assets.initialize_on_precompile = false

但没有解决..

remote: -----> Preparing app for Rails asset pipeline
remote:        Running: rake assets:precompile
remote:        I, [2015-03-09T09:48:26.149234 #564]  INFO -- : Writing /tmp/build_5d5cecb46c0668a271c96a2865c6786b/public/assets/acc_1-9eca273c41a11b370b1de8e501d7a3d8.jpg
remote:        I, [2015-03-09T09:48:26.151582 #564]  INFO -- : Writing /tmp/build_5d5cecb46c0668a271c96a2865c6786b/public/assets/coat_1-7d2d1c111a5b9b809951c179ff8ed007.jpg
remote:        I, [2015-03-09T09:48:26.153681 #564]  INFO -- : Writing /tmp/build_5d5cecb46c0668a271c96a2865c6786b/public/assets/jacket_1-cf738b7bb4ffe92c1c6868222f13ae7c.jpg
remote:        I, [2015-03-09T09:48:31.419965 #564]  INFO -- : Writing /tmp/build_5d5cecb46c0668a271c96a2865c6786b/public/assets/application-79e97ce3b1782017ab5fec3bb7ccf6ef.js
remote:        rake aborted!
remote:        NoMethodError: undefined method `[]' for nil:NilClass
remote:        (in /tmp/build_5d5cecb46c0668a271c96a2865c6786b/app/assets/stylesheets/application.css)
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/sass_functions.rb:63:in `sprockets_context'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sass-rails-4.0.5/lib/sass/rails/helpers.rb:13:in `asset_path'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/script/funcall.rb:113:in `_perform'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/script/node.rb:40:in `perform'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/script/funcall.rb:99:in `block in _perform'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/script/funcall.rb:99:in `map'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/script/funcall.rb:99:in `_perform'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/script/node.rb:40:in `perform'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/tree/visitors/perform.rb:298:in `visit_prop'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/tree/visitors/base.rb:37:in `visit'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/tree/visitors/perform.rb:100:in `visit'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/tree/visitors/base.rb:53:in `block in visit_children'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/tree/visitors/base.rb:53:in `map'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/tree/visitors/base.rb:53:in `visit_children'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/tree/visitors/perform.rb:109:in `block in visit_children'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/tree/visitors/perform.rb:121:in `with_environment'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/tree/visitors/perform.rb:108:in `visit_children'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/tree/visitors/base.rb:37:in `block in visit'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/tree/visitors/perform.rb:356:in `visit_directive
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/tree/visitors/base.rb:37:in `visit'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/tree/visitors/perform.rb:100:in `visit'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/tree/visitors/base.rb:53:in `block in visit_children'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/tree/visitors/base.rb:53:in `map'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/tree/visitors/base.rb:53:in `visit_children'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/tree/visitors/perform.rb:109:in `block in visit_children'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/tree/visitors/perform.rb:121:in `with_environment'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/tree/visitors/perform.rb:108:in `visit_children'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/tree/visitors/base.rb:37:in `block in visit'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/tree/visitors/perform.rb:128:in `visit_root'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/tree/visitors/base.rb:37:in `visit'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/tree/visitors/perform.rb:100:in `visit'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/tree/visitors/perform.rb:7:in `visit'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/tree/root_node.rb:20:in `render'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/engine.rb:315:in `_render'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/engine.rb:262:in `render'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/sass_compressor.rb:24:in `evaluate'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/tilt-1.4.1/lib/tilt/template.rb:103:in `render'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/context.rb:197:in `block in evaluate'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/context.rb:194:in `each'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/context.rb:194:in `evaluate'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/bundled_asset.rb:25:in `initialize'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/base.rb:377:in `new'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/base.rb:377:in `build_asset'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/index.rb:94:in `block in build_asset'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/caching.rb:58:in `cache_asset'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/index.rb:93:in `build_asset'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/base.rb:287:in `find_asset'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/index.rb:61:in `find_asset'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/manifest.rb:211:in `block in find_asset'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/manifest.rb:257:in `benchmark'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/manifest.rb:210:in `find_asset'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/manifest.rb:119:in `block in compile'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/manifest.rb:118:in `each'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/manifest.rb:118:in `compile'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sprockets-rails-2.2.4/lib/sprockets/rails/task.rb:70:in `block (3 levels) in define'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/rake/sprocketstask.rb:146:in `with_logger'
remote:        /tmp/build_5d5cecb46c0668a271c96a2865c6786b/vendor/bundle/ruby/2.0.0/gems/sprockets-rails-2.2.4/lib/sprockets/rails/task.rb:69:in `block (2 levels) in define'



remote:        Tasks: TOP => assets:precompile
remote:        (See full trace by running task with --trace)
remote:  !
remote:  !     Precompiling assets failed.
remote:  !
remote: 
remote:  !     Push rejected, failed to compile Ruby app
remote: 
remote: Verifying deploy...
remote: 
remote: !   Push rejected to yourwardrobe.
remote: 
To https://git.heroku.com/yourwardrobe.git
 ! [remote rejected] master -> master (pre-receive hook declined)

的Gemfile

source 'https://rubygems.org'


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.8'
# Use sqlite3 as the database for Active Record
group :development, :test do
  gem 'sqlite3'
end
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.3'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer',  platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0',          group: :doc

# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring',        group: :development

# Twitter-bootstrap
gem "twitter-bootstrap-rails"

# image upload
gem "carrierwave"

# image resizing
gem "mini_magick"

gem 'omniauth-facebook'

# heroku`enter code here`
group :production do
  gem 'pg'
end
gem 'rails_12factor', group: :production

application.rb中

module Cracker
  class Application < Rails::Application
    config.assets.initialize_on_precompile = false

帮助我..我整天都在玩..

感谢您的回复。我添加

application.css

/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
 * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any styles
 * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
 * file per style scope.
 *
 *= require_tree 
 *= require_self
 */
body {
    padding-top: 60px; 
}

0 个答案:

没有答案