首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Ruby on Rails -在Debian上安装execjs

Ruby on Rails -在Debian上安装execjs
EN

Stack Overflow用户
提问于 2013-10-10 01:28:19
回答 1查看 2K关注 0票数 0

我正在尝试在debian上安装ruby on rails ...我把所有东西都装上了。

我还安装了execjs、therubyracer和node.js。

每次我想创建一个新的控制器时,它都会说:

代码语言:javascript
复制
/usr/local/lib/ruby/gems/2.0.0/gems/execjs-2.0.2/lib/execjs/runtimes.rb:51:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
    from /usr/local/lib/ruby/gems/2.0.0/gems/execjs-2.0.2/lib/execjs.rb:5:in `<module:ExecJS>'
    from /usr/local/lib/ruby/gems/2.0.0/gems/execjs-2.0.2/lib/execjs.rb:4:in `<top (required)>'
    from /usr/local/lib/ruby/gems/2.0.0/gems/uglifier-2.2.1/lib/uglifier.rb:3:in `require'
    from /usr/local/lib/ruby/gems/2.0.0/gems/uglifier-2.2.1/lib/uglifier.rb:3:in `<top (required)>'
    from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
    from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
    from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
    from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
    from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
    from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
    from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
    from /home/adattilo/test/testt/config/application.rb:7:in `<top (required)>'
    from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:44:in `require'
    from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:44:in `<top (required)>'
    from bin/rails:4:in `require'
    from bin/rails:4:in `<main>'

在安装了execjs、therubyracer和node.js之后,我重新启动了系统。

EN

回答 1

Stack Overflow用户

发布于 2013-10-11 22:21:43

对于有可用的二进制版本的therubyracer gem的平台,除了ruby和rubygems之外没有其他依赖项。如果您的系统没有二进制版本,那么您需要从源代码编译它。为此,您必须在系统中的某个位置安装v8 > 3.11.8。

尝试将以下内容添加到Gemfile中

代码语言:javascript
复制
gem 'therubyracer', '0.11.0beta5'
gem 'libv8', '~> 3.11.8'

现在,cd到你的项目和包安装

代码语言:javascript
复制
$ cd <project>
$ bundle install 
票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19278783

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档