首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >试图加载创业板“丑器”时出错。- Wercker

试图加载创业板“丑器”时出错。- Wercker
EN

Stack Overflow用户
提问于 2016-03-16 15:06:22
回答 1查看 2.5K关注 0票数 3

我在将我的应用程序配置给用户wercker时遇到了问题。我的wercker.yml看起来是这样的:

代码语言:javascript
复制
box: ruby
services:
  - postgres
build:
    steps:
        - script:
            name: Nokogiri fix
            code: bundle config build.nokogiri --use-system-libraries
        - bundle-install
        - rails-database-yml
        - script:
            name: Set up db
            code: bundle exec rake db:schema:load RAILS_ENV=test
        - script:
            name: rspec
            code: bundle exec rspec

当我运行build时,它会失败,出现以下错误:

代码语言:javascript
复制
rake aborted!
Bundler::GemRequireError: There was an error while trying to load the gem 'uglifier'.
/pipeline/source/config/application.rb:7:in `<top (required)>'
/pipeline/source/Rakefile:4:in `require'
/pipeline/source/Rakefile:4:in `<top (required)>'
ExecJS::RuntimeUnavailable: Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes.
/pipeline/cache/bundle-install/ruby/2.3.0/gems/execjs-2.6.0/lib/execjs/runtimes.rb:48:in `autodetect'
/pipeline/cache/bundle-install/ruby/2.3.0/gems/execjs-2.6.0/lib/execjs.rb:5:in `<module:ExecJS>'
/pipeline/cache/bundle-install/ruby/2.3.0/gems/execjs-2.6.0/lib/execjs.rb:4:in `<top (required)>'
/pipeline/cache/bundle-install/ruby/2.3.0/gems/uglifier-2.7.2/lib/uglifier.rb:3:in `require'
/pipeline/cache/bundle-install/ruby/2.3.0/gems/uglifier-2.7.2/lib/uglifier.rb:3:in `<top (required)>'
/pipeline/source/config/application.rb:7:in `<top (required)>'
/pipeline/source/Rakefile:4:in `require'
/pipeline/source/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace

我认为我需要在wercker上安装nodejs,但问题是如何做到这一点?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-03-16 19:48:01

正如问题上的注释所示,您需要安装javascript运行时。

你有几个选择:

  1. gem 'therubyracer'添加到Gemfile中。
  2. 通过apt-获取、brew等方式安装nodejs。

我会选择选项2,而不是不必要地为您的项目添加宝石。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/36039547

复制
相关文章

相似问题

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