SPARC Solaris 10 的 Rails 是否有 JavaScript 运行时?

发布于 2024-12-08 04:29:54 字数 506 浏览 8 评论 0原文

我正在尝试让 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 机器上遇到过这个问题,所以我去安装了 ruby​​racer,它不起作用,然后尝试了 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

一抹微笑 2024-12-15 04:29:54

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.

戈亓 2024-12-15 04:29:54

Mozilla Rhino 应该可以在 SPARC 上运行。

Mozilla Rhino should work on SPARC.

青衫负雪 2024-12-15 04:29:54
$ wget http://nodejs.org/dist/node-v0.4.12.tar.gz
$ tar xvzf node-v0.4.12.tar.gz
$ ./configure
$ make
$ make doc
$ sudo make install
$ wget http://nodejs.org/dist/node-v0.4.12.tar.gz
$ tar xvzf node-v0.4.12.tar.gz
$ ./configure
$ make
$ make doc
$ sudo make install
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文