Cap部署资产预编译错误

时间:2016-08-31 11:48:10

标签: ruby-on-rails datatables capistrano asset-pipeline

我正在为我的应用程序设置新的登台服务器。现有的暂存以及具有相同发行版本的开发环境都可以正常工作。

尝试<nav id="site-navigation" class="main-navigation" role="navigation"> <button class="menu-toggle" aria-controls="primary-menu" aria-expanded="false"><?php esc_html_e( 'Menu', 'hitchdiary' ); ?></button> <?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_id' => 'primary-menu', 'menu_class' => 'nav-menu' ) ); ?> </nav><!-- #site-navigation --> ,我收到以下错误:

cap deploy

PNAME /释放/ 20160831113756 /供应商/资产/ bower_components

这是我的 [1906b0ea] Command: cd /home/user/appname/releases/20160831113756 && ( export RAILS_ENV="production" ; ~/.rvm/bin/rvm 2.3.0 do bundle exec rake assets:precompile ) rake aborted! ... Sprockets::FileNotFound: couldn't find file 'datatables' with type 'application/javascript' Checked in these paths: /home/user/appname/shared/bundle/ruby/2.3.0/gems/babel-source-5.8.35/lib /home/user/appname/releases/20160831113756/app/assets/images /home/user/appname/releases/20160831113756/app/assets/javascripts /home/user/appname/releases/20160831113756/app/assets/stylesheets /home/user/appname/shared/bundle/ruby/2.3.0/gems/jquery-datatables-rails-3.3.0/app/assets/images /home/user/appname/shared/bundle/ruby/2.3.0/gems/jquery-datatables-rails-3.3.0/app/assets/javascripts /home/user/appname/shared/bundle/ruby/2.3.0/gems/jquery-datatables-rails-3.3.0/app/assets/media /home/user/appname/shared/bundle/ruby/2.3.0/gems/jquery-datatables-rails-3.3.0/app/assets/stylesheets /home/user/appname/shared/bundle/ruby/2.3.0/gems/cocoon-1.2.8/app/assets/javascripts /home/user/appname/shared/bundle/ruby/2.3.0/gems/turbolinks-2.5.3/lib/assets/javascripts /home/user/appname/shared/bundle/ruby/2.3.0/gems/jquery-rails-4.1.1/vendor/assets/javascripts /home/user/appname/releases/20160831113756/vendor/assets/bower_components /home/user/appname/releases/20160831113756/tmp/themes /home/user/ap 文件             //

application.js

以下是= require jquery //= require jquery_ujs //= require datatables //= require turbolinks //= require cocoon //= require select2 //= require highcharts //= require highcharts/highcharts-more //= require sparklines //= require rangeslider.js/dist/rangeslider //= require Sortable //= require moment //= require pikaday //= require tooltipster //= require urijs //= require jscolor/jscolor //= require_tree .

的部分内容
Gemfile.lock

3.1)

我搜索了几个SO问题,但似乎没有相关问题。

您对可能导致这种情况以及如何解决问题有什么想法吗?

1 个答案:

答案 0 :(得分:0)

我看到你正在使用jquery-datatables-rails gem。

我查看了README的宝石,安装说明说明了引用它的正确方法如下:

# app/assets/javascripts/application.js
//= require dataTables/jquery.dataTables