Rails预编译资产失败 - Errno :: EROFS:只读文件系统@dir_s_mkdir - / assets

时间:2016-03-10 04:54:39

标签: ruby-on-rails heroku

我无法将我的应用部署到heroku。我收到了EROFS错误,这显然意味着actionpack gem正在尝试写入资产,这是只读的?只是一个猜测。我不知道该怎么做。

这是Heroku的日志显示错误:

Running: rake assets:precompile
remote:        /tmp/build_b8b210e2045c2ea425a6220d0ba816ba/vendor/bundle/ruby/2.2.0/gems/activesupport-3.2.11/lib/active_support/values/time_zone.rb:270: warning: circular argument reference - now
remote:        Compiled jquery.js  (3ms)  (pid 2307)
...
remote:        Compiled application.css  (173ms)  (pid 2307)
remote:        rake aborted!
remote:        Errno::EROFS: Read-only file system @ dir_s_mkdir - /assets
remote:        /tmp/build_b8b210e2045c2ea425a6220d0ba816ba/vendor/bundle/ruby/2.2.0/gems/actionpack-3.2.11/lib/sprockets/static_compiler.rb:29:in `write_manifest'
remote:        /tmp/build_b8b210e2045c2ea425a6220d0ba816ba/vendor/bundle/ruby/2.2.0/gems/actionpack-3.2.11/lib/sprockets/static_compiler.rb:25:in `compile'
remote:        /tmp/build_b8b210e2045c2ea425a6220d0ba816ba/vendor/bundle/ruby/2.2.0/gems/actionpack-3.2.11/lib/sprockets/assets.rake:56:in `internal_precompile'
remote:        /tmp/build_b8b210e2045c2ea425a6220d0ba816ba/vendor/bundle/ruby/2.2.0/gems/actionpack-3.2.11/lib/sprockets/assets.rake:70:in `block (3 levels) in <top (required)>'
remote:        /tmp/build_b8b210e2045c2ea425a6220d0ba816ba/vendor/bundle/ruby/2.2.0/gems/actionpack-3.2.11/lib/sprockets/assets.rake:60:in `block (3 levels) in <top (required)>'
remote:        /tmp/build_b8b210e2045c2ea425a6220d0ba816ba/vendor/bundle/ruby/2.2.0/gems/actionpack-3.2.11/lib/sprockets/assets.rake:23:in `invoke_or_reboot_rake_task'
remote:        /tmp/build_b8b210e2045c2ea425a6220d0ba816ba/vendor/bundle/ruby/2.2.0/gems/actionpack-3.2.11/lib/sprockets/assets.rake:29:in `block (2 levels) in <top (required)>'
remote:        Tasks: TOP => assets:precompile:primary
remote:        (See full trace by running task with --trace)
remote:  !
remote:  !     Precompiling assets failed.

这是我的Gemfile,如果有帮助

source 'https://rubygems.org'
gem 'rails', '3.2.11'
gem 'jquery-rails'
gem 'pg'
gem 'thin'
gem "curb", "~> 0.8.4"


group :assets do
  #gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails'
  gem 'uglifier', '>= 1.0.3'
end
gem "sass"#, "~> 3.2"
gem "haml", ">= 3.1.4"
gem "devise", ">= 2.1.0.rc"
gem "simple_form"
gem "nokogiri"

#make heroku not inject 2.3 plugins
gem "rails_12factor"
gem 'jquery-tablesorter', '~> 1.20', '>= 1.20.1'
#gem "datatables", :git => 'git://github.com/Caseproof/datatables.git'
gem "csv-mapper"
gem "lastfm"
gem "songkickr"
gem 'meta-tags', :require => 'meta_tags'
gem "geocoder"
group :development do
  gem "haml-rails", ">= 0.3.4", :group => :development
  gem "heroku", :group => :development
  # gem "powder", :git => "http://github.com/brookr/powder"
end


#gem 'jquery-datatables-rails'

1 个答案:

答案 0 :(得分:0)

rake assets:precompile RAILS_ENV=production运行此命令。它将解决您的问题。