Rails 3.2.8 Application.js 和 Application.css 未按预期工作

2023-11-26

当我尝试包括

<%= stylesheet_link_tag    "application" %>
<%= javascript_include_tag "application" %>

application.css 文件的内容是:

/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the top of the
* compiled file, but it's generally better to create a new file per style scope.
*
*= require_self
*= require social_stream
*= require_tree .
*/

application.js 文件的内容是

// 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 social_stream-base
//= require social_stream-documents
//= require social_stream-events
//= require social_stream-linkser
//= require social_stream-presence
//= require social_stream-oauth2_server
//= require_tree .

我的 Rails 应用程序不包括上面代码片段中所需的 css 和 js 文件。 但是当我将包含标签更新到特定文件时,这些标签都包含得很好。 IE。

<%= stylesheet_link_tag    "social_stream" %>
<%= javascript_include_tag "jquery" %>

我认为链轮存在问题,它没有按预期工作,请提出建议。

我将非常感谢你。


应该是ruby版本问题。你会使用红宝石2.0.0,尝试降级到1.9.2 or 1.9.3。希望它能起作用。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Rails 3.2.8 Application.js 和 Application.css 未按预期工作 的相关文章

随机推荐