好的,所以编译我的资产工作正常,但是当我运行时:
thin start -e production
我的 javascript 或 css 都没有加载。我的浏览器也取消了获取我的资产的请求。我不确定为什么会这样,但我怀疑它是因为它认为它的 404 在它们身上。如果您查看顶部图像,您会看到我的 application.css 文件已编译并存储在我的资产文件夹中,但是当我尝试访问该文件时,我得到了我的 404.html 文件。
是什么赋予了!?
编辑:
我被要求发表我的观点。以下是项目中的一些代码:
<% content_for :title, 'Quick Quote' %>
<% content_for :subtotal, get_subtotal %>
<% content_for :stylesheet_includes do %>
<%= stylesheet_link_tag "quote", "jquery-ui-timepicker-addon" %>
<% end %>
<% if @quote.errors.any? %>
<div class="flash alert">
<% @quote.errors.full_messages.each do |msg| %>
<div><%= msg %></div>
<% end %>
</div>
<% end %>
<h1>Quick Quote</h1>
我的布局:
<!DOCTYPE html>
<html>
<head>
<title><%= (yield(:title) + " - " unless yield(:title).blank?).to_s + "Online Scheduler Order Taker" %></title>
<%= stylesheet_link_tag "application", "jquery-ui-timepicker-addon.css", :media => "all" %>
<%= yield :stylesheet_includes %>
<%= javascript_include_tag "application" %>
<%= yield :javascript_includes %>
<%= csrf_meta_tags %>
</head>
<body>
我的production.rb中的代码
config.assets.precompile += %w( quote.css jquery-ui-timepicker-addon.css prices.css contact.css )
我的 application.css.scss.erb 顶部:
/*
* 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 . <- commented out
* require jquery-ui-timepicker-addon.css <- commented out
*/
我的整个 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 jquery-ui
//= require jquery-ui-timepicker-addon.js
//= require_tree .