Rails 服务器未加载 application.css
Rails server not loading application.css
已经为这个愚蠢的问题道歉。我研究ruby和rails的时间不长,所以对rails了解不多。
我开始使用旧应用程序,并设法将 ruby 、 rails 和 mysql 安装到 Ubuntu 14.04 LTS 中,我能够 运行 服务器没有问题,但无法 运行 来自 app/assets 路径的任何 css 文件。
从一开始,该应用程序也无法 运行 任何 javascript,我设法通过从 app/assets/[=36 顶部的要求代码中删除等号来使其工作=]/application.js 文件:
// This is a manifest file that'll be compiled into including all the files listed below.
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
// be included in the compiled file accessible from http://example.com/assets/application.js
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
// require jquery (was //= require jquery)
// require jquery_ujs (was //= require jquery_ujs)
// require_tree . (was //= require_tree .)
如果我将样式表文件夹从 app/assets 粘贴到 public 文件夹,我可以让页面加载 css,但我知道该应用程序是 运行ning 服务器中的正确路径 运行ning.
那么,除了 public/stylesheet 之外,我还缺少什么才能让我的资产加载 app/assets/stylesheet 文件?
仅供参考,这里是 ruby 和 rails 版本(顺便说一下,已经很老了,我接下来应该解决的另一个问题):
Ruby = ruby 1.9.3p0(2011-10-30 修订版 33570)[x86_64-linux]
Rails = Rails 3.1.3
通过 运行 在生产模式下,我可以追踪到我的应用程序找不到我没有安装的 uglifier。然后我需要添加到我的 gemfile 应用程序,正如它在 link 上所说:
继续前进!
已经为这个愚蠢的问题道歉。我研究ruby和rails的时间不长,所以对rails了解不多。
我开始使用旧应用程序,并设法将 ruby 、 rails 和 mysql 安装到 Ubuntu 14.04 LTS 中,我能够 运行 服务器没有问题,但无法 运行 来自 app/assets 路径的任何 css 文件。 从一开始,该应用程序也无法 运行 任何 javascript,我设法通过从 app/assets/[=36 顶部的要求代码中删除等号来使其工作=]/application.js 文件:
// This is a manifest file that'll be compiled into including all the files listed below.
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
// be included in the compiled file accessible from http://example.com/assets/application.js
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
// require jquery (was //= require jquery)
// require jquery_ujs (was //= require jquery_ujs)
// require_tree . (was //= require_tree .)
如果我将样式表文件夹从 app/assets 粘贴到 public 文件夹,我可以让页面加载 css,但我知道该应用程序是 运行ning 服务器中的正确路径 运行ning.
那么,除了 public/stylesheet 之外,我还缺少什么才能让我的资产加载 app/assets/stylesheet 文件?
仅供参考,这里是 ruby 和 rails 版本(顺便说一下,已经很老了,我接下来应该解决的另一个问题):
Ruby = ruby 1.9.3p0(2011-10-30 修订版 33570)[x86_64-linux]
Rails = Rails 3.1.3
通过 运行 在生产模式下,我可以追踪到我的应用程序找不到我没有安装的 uglifier。然后我需要添加到我的 gemfile 应用程序,正如它在 link 上所说:
继续前进!