eve*_*992 24 ruby ruby-on-rails asset-pipeline
rails资产管道不包括application.js中所需的文件.
呈现给浏览器的唯一javascript文件是application.js,并且require行不会被编译为包含标记,因为它们应该是:
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
// GO AFTER THE REQUIRES BELOW.
//
//= require jquery
//= require jquery_ujs
//= require twitter/bootstrap
//= require bootstrap
//= require_tree .
;
Run Code Online (Sandbox Code Playgroud)
在config/application.rb我有 config.assets.enable = true
我正在使用rails 3.2.8,我尝试使用rvm安装ruby 1.9.3-p398和2.0.0-p0.
如何让application.js包含所需的文件?
编辑:看起来这个问题的锁最近解锁了,活动增加了.自从我研究这个问题已经有一段时间了,代码不再存在了.如果我正确记得我重新安装了ruby和rails并解决了这个问题.
我应该关闭这个问题吗?在这种情况下,正确的程序是什么?
lsa*_*fie 13
我在这里回答:
Rails 3.2.8 Application.js和Application.css不能正常工作
这是文字:
我也有这个问题,但有更新版本的Rails和Ruby.
检查日志,我正在从Rails缓存中获取javascript.js,因为服务器没有看到文件中的更改.我去了并移动了需求线(只有一个)告诉Rails文件有变化并重新编译/使用.Wellm为我做了!
希望它对某人有帮助.
另一个重要发现是升级Gemfile中的sprockets gem.
我有2.2.1版本并且在升级到2.2.2之后出现了问题,它确实有效
gem 'sprockets', '2.2.2'
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
14194 次 |
| 最近记录: |