Capistrano:不知道如何建立任务资产:预编译'

时间:2014-11-04 13:13:57

标签: ruby-on-rails ruby capistrano

我正在尝试使用Capistrano部署rails App。如果我尝试运行“cap production deploy”,我会收到错误“不知道如何构建任务'资产:预编译'”

如果我在服务器上运行“rake assets:precompile”,我会得到同样的错误。

的Gemfile:


    source 'https://rubygems.org'

    # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
    gem 'rails', '4.1.6'
    # Use sqlite3 as the database for Active Record
    gem 'sqlite3'
    # 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'

    # 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

    # Use Capistrano for deployment
    gem 'capistrano', '~> 3.1'
    gem 'capistrano-bundler'#, '~> 1.1.2'
    gem 'capistrano-rails'#, '~> 1.1.1'

    gem 'capistrano-rbenv', '~> 2.0'

Capfile:


    # Load DSL and Setup Up Stages
    require 'capistrano/setup'

    # Includes default deployment tasks
    require 'capistrano/deploy'

    require 'capistrano/rbenv'

    require 'capistrano/bundler'

    require 'capistrano/rails'

    require 'capistrano/rails/assets'

    set :rbenv_type, :user # or :system, depends on your rbenv setup

    Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }

0 个答案:

没有答案