1

I have a rails 6.1 app with an rspec test suite running on ubuntu 20.04 and i use rubymine 2022.1.3 as an IDE when i try to run the tests from the Run configuration like spec for example or when i click on the icon next to the test definition i get this error

/bin/bash -c "env RBENV_VERSION=3.0.3 /home/alex/.rbenv/libexec/rbenv exec ruby -x /var/www/project/bin/bundle exec ruby /var/www/project/bin/rails spec"
Testing started at 5:17 μ.μ. ...
  rails aborted!
ExecJS::RuntimeUnavailable: Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes.
  /var/www/project/config/application.rb:17:in `<top (required)>'
/var/www/project/Rakefile:9:in `require'
/var/www/project/Rakefile:9:in `<top (required)>'
/var/www/project/bin/rails:4:in `require'
/var/www/project/bin/rails:4:in `<main>'
(See full trace by running task with --trace)

i get the same error when i try to run the debugger or tests with coverage and pretty much everything that goes through Run anything

/bin/bash --login -c "env RBENV_VERSION=3.0.3 /home/alex/.rbenv/libexec/rbenv exec rails g controller home"

but not Tools > bundle > install

/bin/bash -c "env RBENV_VERSION=3.0.3 /home/alex/.rbenv/libexec/rbenv exec bundle install"

the app is running just fine locally and deployments are all fine. i even tried installing the execjs, mini_racer and libv8-node gems but i keep getting the same error

if i open another project with rails and rspec the Run configurations run just fine i noticed that the command that rubymine uses to run the tests is slightly different on project with the working Run configurations

/bin/bash -c "env RBENV_VERSION=3.0.3 /home/alex/.rbenv/libexec/rbenv exec ruby -x /var/www/password_manager/bin/bundle exec ruby /var/www/password_manager/bin/spring rails spec"
/bin/bash -c "env RBENV_VERSION=3.0.3 /home/alex/.rbenv/libexec/rbenv exec ruby -x /var/www/project/bin/bundle exec ruby /var/www/project/bin/rails spec"

spring is not running node version: /home/alex/.nvm/versions/node/v16.13.0/bin/node

has anyone encountered this before? is there a way to change the command that rubymine uses?

alex
  • 646
  • 9
  • 19
  • Just to be sure, do you mean that the command being run in the non working project doesn't contain the spring related argument? Does it work with spring disabled? – Olivia Aug 01 '22 at 12:49
  • yes, for some reason the command is different between projects. spring is not running on either projects – alex Aug 03 '22 at 07:46
  • Have you tried disabling it (setting to None the pre-load server) in Run configuration in IDE? – Olivia Aug 03 '22 at 13:13
  • it is set to None by default – alex Aug 04 '22 at 16:17

0 Answers0