Rails 3.2.8 Application.js 和 Application.css 无法正常工作 [英] Rails 3.2.8 Application.js and Application.css are not working as expcted

查看:50
本文介绍了Rails 3.2.8 Application.js 和 Application.css 无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试包含

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

application.css的文件内容为:

The content of the files of the application.css is:

/*
* 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 文件的内容是

And the content of application.js file is

// 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 文件.但是当我将包含标签更新到特定文件时,这些标签被包含在内.即

my rails app is not including the css and js files those are required in the above snippet. but when i update the include tags to the specific file those are included fine. i.e.

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

我认为链轮没有按预期工作的问题请指教.

What i think there is issue of sprockets its not working as expected please advice.

我会非常感谢你.

推荐答案

应该是 ruby​​ 版本问题.您将使用 ruby​​ 2.0.0,尝试降级到 1.9.21.9.3.希望它会起作用.

It should be ruby version issue. You would be using ruby 2.0.0, try to downgrade to 1.9.2 or 1.9.3. Hope it will work.

这篇关于Rails 3.2.8 Application.js 和 Application.css 无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆