如何在RubyMine IDE中运行‘gem install bundler’及相关gem命令?
Hey there, let's walk through how to fix this RubyMine issue step by step! I’ve been in your shoes before, so I know how confusing it can be when the IDE feels disconnected from your terminal commands.
首先:找到RubyMine的内置终端(不用切到系统终端!)
RubyMine comes with a built-in terminal that’s already linked to your project’s Ruby environment—you just need to find it:
- Look for the Terminal tab at the bottom of your IDE window (it’s usually next to Run/Debug tabs). If you don’t see it, go to
View > Tool Windows > Terminalto open it up. - Once it’s open, this terminal is pre-configured to use the Ruby SDK you’ve set for your project, so any commands you run here will apply directly to your IDE’s environment.
执行bundle install(或系统提示的gem bundle install)
Quick note: The standard command for installing bundle dependencies is
bundle install—thegem bundle installvariant is less common, but both should work. Stick withbundle installfirst unless the system specifically insists otherwise.
In the built-in terminal, just type:
bundle install
Hit enter, and it’ll run exactly like it did in your Ubuntu terminal—except now it’s tied directly to your RubyMine project, so the IDE will automatically pick up the updated dependencies once it finishes.
如何在RubyMine中执行gem install bundler
Same built-in terminal method works here too:
- Open the Terminal tool window as described above
- Type this command and hit enter:
gem install bundler
That’s it! Bundler will install into your project’s Ruby SDK, and you’ll be ready to use all bundler commands right in the IDE.
Bonus: Visual Gem Installation (No Terminal Needed)
If you prefer clicking around instead of typing commands, RubyMine has a visual gem manager:
- Go to
File > Settings > Languages & Frameworks > Ruby SDK and Gems(Windows/Linux) orRubyMine > Settings > Languages & Frameworks > Ruby SDK and Gems(Mac) - Select the Ruby SDK your project is using from the left sidebar
- On the right, you’ll see a list of installed gems. If bundler isn’t there, click the
+button in the top-right corner - Search for
bundler, select it from the list, and clickInstall—this does the exact same thing asgem install bundlerbehind the scenes.
Once you’ve done any of these steps, your RubyMine environment should be synced up with the dependencies you installed in your system terminal, and you’ll be good to go!
内容的提问来源于stack exchange,提问作者Marcus Ruddick

