部署 部署的时候出现 “Don't know how to build task 'assets:precompile'”

autumnwolf · November 19, 2014 · Last by autumnwolf replied at November 19, 2014 · 4165 hits

研究了下应该是某个 Gem 导致的这个错误!

bundle exec rake assets:precompile RAILS_ENV=production
RSpec is not part of this bundle, skip specs.
rake aborted!
Don't know how to build task 'assets:precompile'

Gemfile

source 'https://ruby.taobao.org/'
# source 'http://rubygems.org/'

# Distribute your app as a gem
# gemspec

# Server requirements
# gem 'thin' # or mongrel
# gem 'trinidad', :platform => 'jruby'
group :production do
  gem 'unicorn'
end

# Optional JSON codec (faster performance)
# gem 'oj'

# Project requirements
gem 'rake'

# gem 'slim'
gem 'activerecord', '>= 3.1', :require => 'active_record'
# gem 'mysql2'
gem 'mysql2', git: 'https://github.com/brianmario/mysql2.git'

gem 'redis'
gem 'hiredis'
gem 'redis-activesupport'
gem 'second_level_cache', '~>2.1.0.rc2'
gem 'qiniu'
gem 'resque'
gem 'resque-pool', git: 'https://github.com/nevans/resque-pool.git'

# Test requirements
group :test do
  gem 'mocha', :require => false
  gem 'rspec'
  gem 'rack-test', :require => 'rack/test'
end


gem 'sinatra'
gem 'sinatra-contrib'

gem 'multi_json'
gem 'jbuilder', '~> 2.0'
gem 'tilt-jbuilder', :require => "sinatra/jbuilder"
gem 'sinatra-param'

gem 'bcrypt', '~> 3.1.7'


group :development, :test do
  # gem 'jasmine', "~> 1.3.1"
  # profiler
  # gem 'ruby-prof'
  gem 'byebug'
  gem 'annotate', '>= 2.6.0'
  gem 'capistrano',  '~> 3.2.0'
  gem 'capistrano-rails', '~> 1.1.1'
  gem 'capistrano-bundler', '~> 1.1.2'
  gem 'capistrano-rbenv', '~> 2.0.2'
end

又不是 Rails 为什么要用 capistrano-rails

#1 楼 @Rei 我指定 Rails 的任务了所以用这个 Gem

因为你没有用 Rails,所以没有 assets:precompile 这个任务,解决方法是去掉 capistrano-rails,同时为了完成部署,你的部署任务要自己写。

#3 楼 @Rei 哦 理解了,是这个问题!没看到这个项目没用 Rails 多谢了 我删除另一个问题吧

You need to Sign in before reply, if you don't have an account, please Sign up first.