rails资产未编译

时间:2013-09-07 05:10:15

标签: ruby-on-rails ruby-on-rails-3.2 asset-pipeline assets

我跑了rails server并转到http://localhost:3000

我有     <%= stylesheet_link_tag“application”,:media => “全部”%>

在layout.html.erb

这是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_tree .  
*/

是不是被编译为

    <link href="/assets/twitter-bootstrap-static/bootstrap.css?body=1" media="all" rel="stylesheet" type="text/css" /> 
 <link href="/assets/twitter-bootstrap-static/fontawesome.css?body=1" media="all" rel="stylesheet" type="text/css" />  
<link href="/assets/bootstrap_and_overrides.css?body=1" media="all" rel="stylesheet" type="text/css" />

我错过了什么?我正在使用rails 3.2.8我有

# Enable the asset pipeline
config.assets.enabled = true

在application.rb

更新

我跑了之后 RAILS_ENV=development bundle exec rake assets:precompile

我可以看到编译后的资产

1 个答案:

答案 0 :(得分:1)

资产通常不以开发模式编译:http://guides.rubyonrails.org/asset_pipeline.html#in-development

该引用还包含有关预编译资产的信息。