ngCkeditor和Ckeditor,部署资产

时间:2014-06-13 12:22:41

标签: ruby-on-rails deployment capistrano asset-pipeline bower

我有一个rails应用程序,用户可以通过检索角度,角度插件和ng-Ckeditor等资产。我的主要问题是当我尝试部署我的应用程序时出现上述错误。 我找不到发生的事情,我认为这可能是ckeditor gem和bower的ng-ckeditor的一些问题。 在错误消息下,我将粘贴我的production.rb,deploy,gemfile,以告诉我你是否看错了。

ExecJS::ProgramError: Unexpected token: eof (undefined) (line: 11, col: 0, pos: 286)

Error

at new JS_Parse_Error (/tmp/execjs20140613-30493-1mkpf99js:2357:10754)
at js_error (/tmp/execjs20140613-30493-1mkpf99js:2357:10973)
at croak (/tmp/execjs20140613-30493-1mkpf99js:2357:19198)
at token_error (/tmp/execjs20140613-30493-1mkpf99js:2357:19335)
at unexpected (/tmp/execjs20140613-30493-1mkpf99js:2357:19423)
at block_ (/tmp/execjs20140613-30493-1mkpf99js:2357:24668)

at ctor.body (/tmp/execjs20140613-30493-1mkpf99js:2357:24322)
at function_ (/tmp/execjs20140613-30493-1mkpf99js:2357:24387)
at expr_atom (/tmp/execjs20140613-30493-1mkpf99js:2357:27439)

at maybe_unary (/tmp/execjs20140613-30493-1mkpf99js:2357:30108)
(in /home/******/site/shared/bundle/ruby/2.1.0/bundler/gems/ckeditor-84ef6a7e3ee8/app/assets/javascripts/ckeditor/override.js.erb)

Production.rb

config.assets.precompile << Rails.root.join('vendor', 'assets', 'bower_components')
config.assets.precompile += Ckeditor.assets

Deploy.rb

before 'deploy:assets:precompile', 'deploy:assets:install'
namespace :deploy do
  namespace :assets do
    desc 'install asset dependencies'
      task :install do
      run "cd #{latest_release} && bundle exec rake bower:clean"
      run "cd #{latest_release} && bundle exec rake bower:update:prune['--config.interactive=false']"
      run "cd #{latest_release} && rm vendor/assets/bower_components/ng-ckeditor/LICENSE"
      run "cd #{latest_release} && mv vendor/assets/bower_components/ng-ckeditor/src/styles/ng-ckeditor.less vendor/assets/bower_components/ng-ckeditor/src/styles/ng-ckeditor.scss"
    end
  end
end

Application.js和admin / application.js

//= require jquery
//= require jquery_ujs
//= require bootstrap
//= require jquery_nested_form
//= require ckeditor/override
//= require ckeditor/init
//= require underscore-min
//= require microplugin
//= require sifter.min
//= require selectize.min
//= require isotope.pkgd.min
//= require fit-columns
//= require jquery.screwdefaultbuttonsV2
//= require fancySelect
//= require flash
//= require notifications
//= require reviews
//= require raty
//= require how
//= require teachers
//= require init
//= require angular
//= require angular-resource
//= require angular-xeditable
//= require angular-sanitize
//= require angular-bootstrap
//= require ng-ckeditor
//= require app
//= require_tree ./angular

导入是当我从application.js(+ admin)中删除ckeditor / override部署完成但是ckeditor of gem没有与ng-ckeditor相反而继续播放

我相信ng-ckeditor初始化自己的ckeditor。

1 个答案:

答案 0 :(得分:0)

对于任何可能需要帮助的人,我通过

解决了这个问题

config.assets.js_compressor = Uglifier.new(mangle: false)