Content
Precompilation on Production Server
Added by evaluations consultant about 6 years ago
Hi
I am trying to do precompilation on the production instance and used the following command:
RAILS_ENV=“production” bundle exec rake assets:precompile
I get the following error, which I think asks me to install a javascript runtime. But isn’t node.js included with the open project distribution?
Can you help me understand what I am doing wrong here?
I am using rpms installed on ubuntu (Open Project 7.4)
rake aborted!
Bundler::GemRequireError: There was an error while trying to load the gem ‘autoprefixer-rails’.
Gem Load Error is: Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes.
Backtrace for gem load error is:
/opt/openproject/vendor/bundle/ruby/2.4.0/gems/execjs-2.7.0/lib/execjs/runtimes.rb:58:in `autodetect’
/opt/openproject/vendor/bundle/ruby/2.4.0/gems/execjs-2.7.0/lib/execjs.rb:5:in `module:ExecJS’
/opt/openproject/vendor/bundle/ruby/2.4.0/gems/execjs-2.7.0/lib/execjs.rb:4:in `<top (required)>’
/opt/openproject/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.6/lib/active_support/dependencies.rb:293:in `require’
/opt/openproject/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.6/lib/active_support/dependencies.rb:293:in `block in require’
/opt/openproject/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.6/lib/active_support/dependencies.rb:259:in `load_dependency’
/opt/openproject/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.6/lib/active_support/dependencies.rb:293:in `require’
/opt/openproject/vendor/bundle/ruby/2.4.0/gems/autoprefixer-rails-7.1.5/lib/autoprefixer-rails/processor.rb:2:in `<top (required)>’
/opt/openproject/vendor/bundle/ruby/2.4.0/gems/autoprefixer-rails-7.1.5/lib/autoprefixer-rails.rb:36:in `require_relative’
/opt/openproject/vendor/bundle/ruby/2.4.0/gems/autoprefixer-rails-7.1.5/lib/autoprefixer-rails.rb:36:in `<top (required)>’
/opt/openproject/vendor/ruby-2.4.4/lib/ruby/gems/2.4.0/gems/bundler-1.16.3/lib/bundler/runtime.rb:81:in `require’
/opt/openproject/vendor/ruby-2.4.4/lib/ruby/gems/2.4.0/gems/bundler-1.16.3/lib/bundler/runtime.rb:81:in `block (2 levels) in require’
/opt/openproject/vendor/ruby-2.4.4/lib/ruby/gems/2.4.0/gems/bundler-1.16.3/lib/bundler/runtime.rb:76:in `each’
/opt/openproject/vendor/ruby-2.4.4/lib/ruby/gems/2.4.0/gems/bundler-1.16.3/lib/bundler/runtime.rb:76:in `block in require’
/opt/openproject/vendor/ruby-2.4.4/lib/ruby/gems/2.4.0/gems/bundler-1.16.3/lib/bundler/runtime.rb:65:in `each’
/opt/openproject/vendor/ruby-2.4.4/lib/ruby/gems/2.4.0/gems/bundler-1.16.3/lib/bundler/runtime.rb:65:in `require’
/opt/openproject/vendor/ruby-2.4.4/lib/ruby/gems/2.4.0/gems/bundler-1.16.3/lib/bundler.rb:114:in `require’
/opt/openproject/config/application.rb:70:in `<top (required)>’
/opt/openproject/Rakefile:33:in `require’
/opt/openproject/Rakefile:33:in `<top (required)>’
/opt/openproject/vendor/bundle/ruby/2.4.0/gems/rake-12.1.0/lib/rake/rake_module.rb:29:in `load’
/opt/openproject/vendor/bundle/ruby/2.4.0/gems/rake-12.1.0/lib/rake/rake_module.rb:29:in `load_rakefile’
/opt/openproject/vendor/bundle/ruby/2.4.0/gems/rake-12.1.0/lib/rake/application.rb:688:in `raw_load_rakefile’
/opt/openproject/vendor/bundle/ruby/2.4.0/gems/rake-12.1.0/lib/rake/application.rb:97:in `block in load_rakefile’
/opt/openproject/vendor/bundle/ruby/2.4.0/gems/rake-12.1.0/lib/rake/application.rb:179:in `standard_exception_handling’
/opt/openproject/vendor/bundle/ruby/2.4.0/gems/rake-12.1.0/lib/rake/application.rb:96:in `load_rakefile’
/opt/openproject/vendor/bundle/ruby/2.4.0/gems/rake-12.1.0/lib/rake/application.rb:80:in `block in run’
/opt/openproject/vendor/bundle/ruby/2.4.0/gems/rake-12.1.0/lib/rake/application.rb:179:in `standard_exception_handling’
/opt/openproject/vendor/bundle/ruby/2.4.0/gems/rake-12.1.0/lib/rake/application.rb:78:in `run’
/opt/openproject/vendor/bundle/ruby/2.4.0/gems/rake-12.1.0/exe/rake:27:in `<top (required)>’
/opt/openproject/vendor/bundle/ruby/2.4.0/bin/rake:23:in `load’
/opt/openproject/vendor/bundle/ruby/2.4.0/bin/rake:23:in `<top (required)>’
/opt/openproject/vendor/ruby-2.4.4/lib/ruby/gems/2.4.0/gems/bundler-1.16.3/lib/bundler/cli/exec.rb:74:in `load’
/opt/openproject/vendor/ruby-2.4.4/lib/ruby/gems/2.4.0/gems/bundler-1.16.3/lib/bundler/cli/exec.rb:74:in `kernel_load’
/opt/openproject/vendor/ruby-2.4.4/lib/ruby/gems/2.4.0/gems/bundler-1.16.3/lib/bundler/cli/exec.rb:28:in `run’
/opt/openproject/vendor/ruby-2.4.4/lib/ruby/gems/2.4.0/gems/bundler-1.16.3/lib/bundler/cli.rb:424:in `exec’
/opt/openproject/vendor/ruby-2.4.4/lib/ruby/gems/2.4.0/gems/bundler-1.16.3/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run’
/opt/openproject/vendor/ruby-2.4.4/lib/ruby/gems/2.4.0/gems/bundler-1.16.3/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command’
/opt/openproject/vendor/ruby-2.4.4/lib/ruby/gems/2.4.0/gems/bundler-1.16.3/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch’
/opt/openproject/vendor/ruby-2.4.4/lib/ruby/gems/2.4.0/gems/bundler-1.16.3/lib/bundler/cli.rb:27:in `dispatch’
/opt/openproject/vendor/ruby-2.4.4/lib/ruby/gems/2.4.0/gems/bundler-1.16.3/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start’
/opt/openproject/vendor/ruby-2.4.4/lib/ruby/gems/2.4.0/gems/bundler-1.16.3/lib/bundler/cli.rb:18:in `start’
/opt/openproject/vendor/ruby-2.4.4/lib/ruby/gems/2.4.0/gems/bundler-1.16.3/exe/bundle:30:in `block in <top (required)>’
/opt/openproject/vendor/ruby-2.4.4/lib/ruby/gems/2.4.0/gems/bundler-1.16.3/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors’
/opt/openproject/vendor/ruby-2.4.4/lib/ruby/gems/2.4.0/gems/bundler-1.16.3/exe/bundle:22:in `<top (required)>’
/opt/openproject/vendor/ruby-2.4.4/bin/bundle:23:in `load’
/opt/openproject/vendor/ruby-2.4.4/bin/bundle:23:in `
’
Bundler Error Backtrace:
/opt/openproject/config/application.rb:70:in `<top (required)>’
/opt/openproject/Rakefile:33:in `require’
/opt/openproject/Rakefile:33:in `<top (required)>’
/opt/openproject/vendor/bundle/ruby/2.4.0/gems/rake-12.1.0/exe/rake:27:in `<top (required)>’
/opt/openproject/vendor/ruby-2.4.4/bin/bundle:23:in `load’
/opt/openproject/vendor/ruby-2.4.4/bin/bundle:23:in `
’
ExecJS::RuntimeUnavailable: Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes.
/opt/openproject/vendor/bundle/ruby/2.4.0/gems/execjs-2.7.0/lib/execjs/runtimes.rb:58:in `autodetect’
/opt/openproject/vendor/bundle/ruby/2.4.0/gems/execjs-2.7.0/lib/execjs.rb:5:in `module:ExecJS’
/opt/openproject/vendor/bundle/ruby/2.4.0/gems/execjs-2.7.0/lib/execjs.rb:4:in `<top (required)>’
/opt/openproject/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.6/lib/active_support/dependencies.rb:293:in `require’
/opt/openproject/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.6/lib/active_support/dependencies.rb:293:in `block in require’
/opt/openproject/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.6/lib/active_support/dependencies.rb:259:in `load_dependency’
/opt/openproject/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.6/lib/active_support/dependencies.rb:293:in `require’
/opt/openproject/vendor/bundle/ruby/2.4.0/gems/autoprefixer-rails-7.1.5/lib/autoprefixer-rails/processor.rb:2:in `<top (required)>’
/opt/openproject/vendor/bundle/ruby/2.4.0/gems/autoprefixer-rails-7.1.5/lib/autoprefixer-rails.rb:36:in `require_relative’
/opt/openproject/vendor/bundle/ruby/2.4.0/gems/autoprefixer-rails-7.1.5/lib/autoprefixer-rails.rb:36:in `<top (required)>’
/opt/openproject/config/application.rb:70:in `<top (required)>’
/opt/openproject/Rakefile:33:in `require’
/opt/openproject/Rakefile:33:in `<top (required)>’
/opt/openproject/vendor/bundle/ruby/2.4.0/gems/rake-12.1.0/exe/rake:27:in `<top (required)>’
/opt/openproject/vendor/ruby-2.4.4/bin/bundle:23:in `load’
/opt/openproject/vendor/ruby-2.4.4/bin/bundle:23:in `
’
(See full trace by running task with —trace)
Replies (1)
I understand you are using a packaged installation. If that is the case you can use
to run asset precompilation. Please also see the documentation