我在我的 Ubuntu Linux Box 上安装 rails(v3) &安装失败,抱怨缺少 javascript 运行时.我做了一些查找&事实证明,rails 需要在其运行的平台上安装一个 javascript 运行时.
I was installing rails(v3) on my Ubuntu Linux Box & the install failed complaining of missing javascript runtime. I did some lookup & it turns out that rails require a javascript runtime to be installed on the platform its running.
虽然,默认情况下,Windows 已与 jscript 捆绑在一起.我的 Ubuntu 盒子没有 js 运行时 &我通过安装 node.js(V8) 解决了这个问题.
While, Windows has come bundled with jscript by default. My Ubuntu box didn't have a js runtime & I fixed the issue by installing node.js(V8).
AFAIK,需要一个 js 运行时来执行 javascript 代码 &rails 只是一个嵌入了 javascript 的 Web 框架.Javascript 文件仅在客户端计算机上运行.
AFAIK, a js runtime is required to execute javascript code & rails is just a web framework in which javascript are embedded. Javascript files run only on client machines.
所以,为什么 Rails 需要 JavaScript 运行时?
推荐答案查看 Rails Asset Pipeline.它对 JavaScript(和 CSS)文件做了一些奇特的事情.值得注意的是:
Look into the Rails Asset Pipeline. It does fancy stuff with JavaScript (and CSS) files. Notably:
JavaScript 运行时用于缩小.
The JavaScript runtime is used for minification.
更多推荐
为什么 rails 需要 JavaScript 运行时?
发布评论