2

On my Elementary OS machine (an Ubuntu-based OS), after creating a new Ruby on Rails project with rails new yarntest and loading it in RubyMine, I could not launch it with RubyMine's "Development: yarntest" run configuration. The output was:

=> Booting Puma
=> Rails 6.0.1 application starting in development 
=> Run `rails server --help` for more startup options
Yarn requires Node.js 4.0 or higher to be installed.


========================================
  Your Yarn packages are out of date!
  Please run `yarn install --check-files` to update.
========================================


To disable this check, please change `check_yarn_integrity`
to `false` in your webpacker config file (config/webpacker.yml).

However, running rails server in the console worked.

I tried reinstalling Yarn, but it still did not work.

I could only disable the Yarn integrity check in the Ruby on Rails config as stated in the error message (deleting the yarn.lock also appeared to work, but is surely wrong). Similarly, I did not want to track down and remove the different Yarn version, as suggested on another question, since the issue was with RubyMine.

J0hj0h
  • 894
  • 1
  • 8
  • 34
  • just to be sure, does it mean that running rails server manually in the Terminal doesn't show that message? (in case you don't use sudo) – Olivia Nov 25 '19 at 22:42
  • Exactly. Running the command in the terminal without sudo works fine. – J0hj0h Nov 26 '19 at 08:40
  • Does it behave the same way in case you launch RubyMine from the terminal where it works? – Olivia Nov 26 '19 at 12:13
  • Yes, launching Ruby Mine from the terminal does solve the issue. Do you know of a way to fix this permanently? – J0hj0h Nov 26 '19 at 17:44
  • 1
    There's a similar request on the tracker with possible workarounds, please take a look: https://youtrack.jetbrains.com/issue/IDEABKL-7589 – Olivia Dec 03 '19 at 18:06
  • Thank you so much for your help! – J0hj0h Dec 04 '19 at 18:05
  • Does this answer your question? [Rubymine and yarn](https://stackoverflow.com/questions/50078826/rubymine-and-yarn) – Kick Buttowski Dec 04 '19 at 18:09
  • @KickButtowski As I mentioned in a comment on an answer for that question (https://stackoverflow.com/questions/50078826/rubymine-and-yarn#comment104283799_57387534), this Q&A is supposed to cover another error message. Olivia helped me understand the underlying issues, which are not covered in that question. – J0hj0h Dec 04 '19 at 18:20

1 Answers1

2

I came across an answer on another question that mentioned this error message when running sudo yarn install (i. e. in sudo mode). I tried running sudo yarn install and could finally reproduce the error message outside of RubyMine's run config. Apparently, when running in sudo mode, the yarn binary was outdated.

The solution is therefore to point RubyMine to the correct yarn binary.

The easiest way to do that is to launch RubyMine from the terminal with rubymine, as pointed out by Olivia. See the related JetBrains ticket.

J0hj0h
  • 894
  • 1
  • 8
  • 34
  • Workaround 1: make required variables available in a login shell (i.e. for Bash, move them from .bashrc to .bash_profile or .profile), then restart X session (logout/login). Workaround 2: run IDE from a terminal Workaround 3: edit IDE desktop launcher and set command to /bin/bash -l -i -c "/path/to/webstorm.sh" – hizmarck Apr 10 '20 at 22:41