You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

RubyMine用Run启动RoR项目报错,控制台rails s正常问题求助

Fixing Yarn Integrity Error When Starting Rails App via RubyMine Run

I’ve run into this exact frustrating issue before—when the terminal works but the IDE throws an error! Here’s what’s going on and how to fix it:

Why This Happens

RubyMine’s Run configuration might be using a slightly different environment than your system terminal (like a mismatched PATH or Yarn version), or your project’s Yarn lock file is out of sync with installed dependencies. The rails s command in the terminal might silently bypass the integrity check, while RubyMine’s Run trigger enforces it explicitly.

The error message points to the most straightforward fix first—just sync your packages:

  1. Open RubyMine’s built-in terminal (or your system terminal in the project root).
  2. Run this command to align installed packages with your yarn.lock file:
    yarn install
    

Once this finishes, try starting the app via Shift+F10 again—it should resolve the integrity warning and run smoothly.

Solution 2: Disable the Yarn Integrity Check (Quick Fix)

If you don’t want to update packages right now, you can turn off the check entirely:

  1. Open config/environments/development.rb in your project.
  2. Inside the Rails.application.configure do block, add this line:
    config.webpacker.check_yarn_integrity = false
    
  3. Save the file and restart your Rails server via RubyMine’s Run button.

Solution 3: Align RubyMine’s Environment with Your Terminal

Sometimes the IDE uses a different shell or PATH than your terminal, leading to version mismatches:

  1. Go to Run > Edit Configurations in RubyMine.
  2. Select your Rails server configuration from the list.
  3. Under the Environment tab, verify the PATH variable includes the path to your Yarn installation (you can find this by running which yarn in your terminal).
  4. Alternatively, set the Shell path to your default shell (e.g., /bin/zsh or /bin/bash) to ensure it inherits the same environment variables as your terminal.
  5. Apply the changes and try running the app again.

内容的提问来源于stack exchange,提问作者Dmitry Maltsev

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.26 09:21:55