我今天在使用 Ruby on Rails 时遇到了一个令人不安的问题。我的资产没有被编译:我的意思是即使使用asset:precompiled,它们也没有被编译。
我相信这将更好地说明问题。预编译资产后,/public/assets/application.js 如下所示:
// This is a manifest file that'll be compiled into including all the files listed below.
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
// be included in the compiled file accessible from http://example.com/assets/application.js
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
//= require jquery
//= require jquery-ui
//= require jquery_ujs
//= require twitter/bootstrap
//= require_tree .
;
css也是如此。该项目在其他计算机上运行良好,所以我怀疑我的配置在这里有问题。但是什么可能导致这种问题呢?Rails 并不是不尝试预编译,而是当他得到文件时,他只是将它们复制到资产文件夹而不预编译它们。
关于如何解决这个问题的任何线索?
编辑:添加资产输出:预编译
** Invoke assets:precompile (first_time)
** Execute assets:precompile
/home/plaristote/.rvm/rubies/ruby-2.0.0-p0/bin/ruby /home/plaristote/.rvm/gems/ruby-2.0.0-p0@visibleo_commApp/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets --trace
** Invoke assets:precompile:all (first_time)
** Execute assets:precompile:all
** Invoke assets:precompile:primary (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
** Invoke tmp:cache:clear (first_time)
** Execute tmp:cache:clear
** Execute assets:precompile:primary
/home/plaristote/.rvm/rubies/ruby-2.0.0-p0/bin/ruby /home/plaristote/.rvm/gems/ruby-2.0.0-p0@visibleo_commApp/bin/rake assets:precompile:nondigest RAILS_ENV=production RAILS_GROUPS=assets --trace
** Invoke assets:precompile:nondigest (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
** Invoke tmp:cache:clear (first_time)
** Execute tmp:cache:clear
** Execute assets:precompile:nondigest