SPARC Solaris 10 的 Rails 是否有 JavaScript 运行时?
我正在尝试让 Rails 在 Solaris 10 计算机 (SPARC) 上运行。我已经安装了 ruby 和 Rails,并且能够创建一个新项目。当我尝试启动 Rail 服务器时,我得到:
/export/home/eseifert/lib/ruby/gems/1.9.1/gems/execjs-1.2.9/lib/execjs/runtimes.rb:47:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
我之前在我的 Linux 机器上遇到过这个问题,所以我去安装了 rubyracer,它不起作用,然后尝试了 node.js,它也不起作用。这些似乎不支持 SPARC。有人知道可以在 SPARC 机器上运行的 javascript 运行时吗?
I am trying to get rails running on a solaris 10 machine (SPARC). I have got ruby and rails installed and was able to create a new project. When I try to start the rail server, I get:
/export/home/eseifert/lib/ruby/gems/1.9.1/gems/execjs-1.2.9/lib/execjs/runtimes.rb:47:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
I have ran into this before on my linux machine, so I went to install therubyracer, which did not work and then tried node.js, which also does not work. It seems these do not support SPARC. Does any one know of a javascript runtime that will work on a SPARC machine?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Coffee-script 是 Rails 3.1 中的新增功能,可将 .coffee 文件编译为 .js 文件。如果您的应用程序不使用 CoffeeScript,您不会丢失任何内容,因为您可以只编写简单的 JavaScript。即使 3.1 已经发布,许多人仍然继续这样做。
如果您确实想使用咖啡脚本(或需要它),您需要自己构建一个 javascript 运行时或获取 Solaris 10 二进制文件。我没有太多运气找到二进制文件。您可能必须执行通常的“安装 GNU 工具”,然后获取 Spidermonkey 或 Node.js 源代码。请注意,此列表并不详尽。从runtimes.rb 文件中:
RubyRacer、RubyRhino、Johnson、Mustang、Node、JavaScriptCore (Mac)、SpiderMonkey 和 JScript (Windows) 是有效的运行时。
让 Node.js 工作可能并不太难。但你必须安装所有 GNU 工具(如 gcc 等)。已经有一些关于如何做到这一点的指南。它涉及从 sunfreeware.com 等进行大量下载。如果这将是一个学习 Rails 的开发工具,您很可能需要它们,因为许多 gems 编译 C 代码。
Coffee-script is new in rails 3.1 compiles .coffee files into .js files. If your app is not using coffeescript, you won't lose anything because you can write just plain javascript. Many people continue to do this even though 3.1 is out.
If you really want to play around with coffee-script (or need it), you'll need to build a javascript runtime yourself or get a Solaris 10 binary. I didn't have much luck finding a binary. You may have to do the usual "install the GNU tools" and then grab the spidermonkey or node.js source. Note that this list is not exhaustive. From the runtimes.rb file:
RubyRacer, RubyRhino, Johnson, Mustang, Node, JavaScriptCore (Mac), SpiderMonkey and JScript (Windows) are valid runtimes.
Getting node.js to work probably is not too hard. But you have to have all the GNU tools installed (like gcc etc). There are a few guides already out there on how to do that. It involves lots of downloading from sunfreeware.com etc. If this is going to be a development box to learn rails on, you'll most likely need them because many gems compile C code.
Mozilla Rhino 应该可以在 SPARC 上运行。
Mozilla Rhino should work on SPARC.