我在生产模式上遇到资产预编译的一个大问题......
我使用RequireJS和Conditioner.js来模块化我的前端,我的开发服务器上没有问题(没有资产预编译),但我不能在生产时预编译资产。
这是我的requirejs.yml配置:
map:
'*':
conditioner: "lib/conditioner"
modules:
- name: "application"
- name: "jquery"
- name: "conditioner"
paths:
jquery: "lib/jquery"
conditioner: "lib/conditioner"
priority: ['jquery', 'conditioner', 'application']
这是我控制台的堆栈:
Requirejs::BuildError: Cannot compute digest for missing asset:/home/birdnet/rails_projects/reczna-chks.pl/tmp/requirejs/dst/conditioner.js
/home/birdnet/.rvm/gems/ruby-2.1.2@reczna-chks/gems/requirejs-rails-0.9.5/lib/requirejs/rails/builder.rb:22:in `digest_for'
/home/birdnet/.rvm/gems/ruby-2.1.2@reczna-chks/gems/requirejs-rails-0.9.5/lib/tasks/requirejs-rails_tasks.rake:149:in `block (5 levels) in <top (required)>'
/home/birdnet/.rvm/gems/ruby-2.1.2@reczna-chks/gems/requirejs-rails-0.9.5/lib/tasks/requirejs-rails_tasks.rake:149:in `sub'
/home/birdnet/.rvm/gems/ruby-2.1.2@reczna-chks/gems/requirejs-rails-0.9.5/lib/tasks/requirejs-rails_tasks.rake:149:in `block (4 levels) in <top (required)>'
/home/birdnet/.rvm/gems/ruby-2.1.2@reczna-chks/gems/requirejs-rails-0.9.5/lib/tasks/requirejs-rails_tasks.rake:146:in `each'
/home/birdnet/.rvm/gems/ruby-2.1.2@reczna-chks/gems/requirejs-rails-0.9.5/lib/tasks/requirejs-rails_tasks.rake:146:in `block (3 levels) in <top (required)>'
Tasks: TOP => requirejs:precompile:all => requirejs:precompile:digestify_and_compress
(See full trace by running task with --trace)
rake aborted!
Command failed with status (1): [/home/birdnet/.rvm/rubies/ruby-2.1.2/bin/r...]
/home/birdnet/.rvm/gems/ruby-2.1.2@reczna-chks/gems/requirejs-rails-0.9.5/lib/tasks/requirejs-rails_tasks.rake:19:in `ruby_rake_task'
/home/birdnet/.rvm/gems/ruby-2.1.2@reczna-chks/gems/requirejs-rails-0.9.5/lib/tasks/requirejs-rails_tasks.rake:86:in `block (3 levels) in <top (required)>'
/home/birdnet/.rvm/gems/ruby-2.1.2@reczna-chks/bin/ruby_executable_hooks:15:in `eval'
/home/birdnet/.rvm/gems/ruby-2.1.2@reczna-chks/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => assets:precompile => requirejs:precompile:external
这似乎是一个不好的配置路径,但在我看来,每条路径看起来都不错。
任何人都可以帮助我吗?我真的陷入了困境,但却没有在生产中禁用预编译。
答案 0 :(得分:0)
尝试将模块中的路径更改为: - 名称:“lib / conditioner”