diaspora/diaspora

Upgrade fails because of execjs broken dependency

milouse opened this issue · 2 comments

As the new v0.7.16.0 tag has been published, I tried today to upgrade my diaspora installation. My upgrade routine include checkout first Gemfile.lock and Gemfile, then checkouting the release tag.

After checkout, I edit the Gemfile to add a ruby-js thing as my server runs linux (Debian 10.11 up-to-date).

However this turns to a complete nightmare :/

If I just uncomment the therubyracer line in the Gemfile, bundle succeed, but after that, all rake commands will fail with:

$ RAILS_ENV=production bin/rake db:migrate
rake aborted!
ExecJS::RuntimeUnavailable: Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes.
[redacted]/diaspora/vendor/bundle/ruby/2.6.0/gems/execjs-2.8.1/lib/execjs/runtimes.rb:58:in `autodetect'
[redacted]/diaspora/vendor/bundle/ruby/2.6.0/gems/execjs-2.8.1/lib/execjs.rb:5:in `<module:ExecJS>'
[redacted]/diaspora/vendor/bundle/ruby/2.6.0/gems/execjs-2.8.1/lib/execjs.rb:4:in `<top (required)>'
[redacted]/diaspora/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.6.2/lib/active_support/dependencies.rb:291:in `require'
[redacted]/diaspora/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.6.2/lib/active_support/dependencies.rb:291:in `block in require'
[redacted]/diaspora/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.6.2/lib/active_support/dependencies.rb:257:in `load_dependency'
[redacted]/diaspora/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.6.2/lib/active_support/dependencies.rb:291:in `require'
[redacted]/diaspora/vendor/bundle/ruby/2.6.0/gems/terser-1.1.7/lib/terser.rb:6:in `<top (required)>'
[redacted]/diaspora/config/application.rb:11:in `<top (required)>'
[redacted]/diaspora/Rakefile:10:in `require'
[redacted]/diaspora/Rakefile:10:in `<top (required)>'
(See full trace by running task with --trace)

It seems that execjs gem does not support therubyracer anymore.

i don’t remember why or where I found this information, but previously I was using mini_racer instead. However if I replace the therubyracer line by a mini_racer one, the bundle call will fail:

$ bin/bundle --full-index
[…]
Fetching libv8-node 16.10.0.0 (x86_64-linux-musl)
Installing libv8-node 16.10.0.0 (x86_64-linux-musl)
Bundler::GemNotFound: Could not find libv8-node-16.10.0.0-x86_64-linux.gem for installation
An error occurred while installing libv8-node (16.10.0.0), and Bundler cannot continue.
Make sure that `gem install libv8-node -v '16.10.0.0'` succeeds before bundling.

In Gemfile:
  mini_racer was resolved to 0.6.2, which depends on
    libv8-node

A quick googling session learn me to use the BUNDLE_FORCE_RUBY_PLATFORM=1 in front of the bundle call to make it works. But using it just makes it fail later :(

$ BUNDLE_FORCE_RUBY_PLATFORM=1 bin/bundle --full-index

So now my diaspora instance is down :(

Any idea what to do / what to use to have a working execjs environment?

Thank you very much for your assistance.

jhass commented

Please just install Nodejs and don't modify the Gemfile or Gemfile.lock in any way.

Thank you very much, it work by installing system nodejs. Gemfile should be updated to remove reference to therhinoracer and instead explain to install system nodejs? What do you think?