Install missing gems fails

已回答

I am brand new to Ruby and Rubymine after years of PhpStorm use.

I have created a starter Gem using  `bundle gem my-gem-name` and then in RubyMine I get:

RubyMine Gem Manager
RubyMine has detected that
some of the gems required for 'vagrant-wplib-box'
are not installed


When I try to "Install missing gems" the result in the command window (on Mac OS X) is the following:

/usr/bin/ruby -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) install
40:233: execution error: -e:1:in `load': cannot load such file -- install (LoadError)
from -e:1:in `<main>'
(1)

Process finished with exit code 1

And I get the same error for pretty much any other Bundler Tools menu command.

Two questions:

1. How do I fix this?

2. What Gems are missing?

Thanks in advance.

------------------
BTW, here is my environment:

RUBYGEMS VERSION: 2.6.4
RUBY VERSION: 2.0.0 (2015-12-16 patchlevel 648) [universal.x86_64-darwin15]
INSTALLATION DIRECTORY: /Library/Ruby/Gems/2.0.0
USER INSTALLATION DIRECTORY: /Users/mikeschinkel/.gem/ruby/2.0.0
RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
EXECUTABLE DIRECTORY: /usr/bin
SPEC CACHE DIRECTORY: /Users/mikeschinkel/.gem/specs
SYSTEM CONFIGURATION DIRECTORY: /Library/Ruby/Site
RUBYGEMS PLATFORMS:
ruby
universal-darwin-15
GEM PATHS:
/Library/Ruby/Gems/2.0.0
/Users/mikeschinkel/.gem/ruby/2.0.0
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/gems/2.0.0
GEM CONFIGURATION:
:update_sources => true
:verbose => true
:backtrace => false
:bulk_threshold => 1000
REMOTE SOURCES:
https://rubygems.org/
SHELL PATH:
/usr/bin
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/gems/2.0.0/bin
/usr/bin
/bin
/usr/sbin
/sbin
/usr/local/bin
----------------------
IDE: RubyMine 2016.1, build #RM-145.597
OS: Mac OS X 10.11.4[x86_64]
Java: 1.8.0_40-release-b132
RubyMine SDK Environment:
Sdk: ruby-2.0.0-p648
Sdk Version: ver.2.0.0p648 ( revision 53162) p648
Ruby Interpreter: /usr/bin/ruby
RVM Sdk: no
RVM Home: [n/a]
Sdk Language Level: 2.0
Sdk Load Path:
/Library/Ruby/Site/2.0.0
/Library/Ruby/Site/2.0.0/universal-darwin15
/Library/Ruby/Site
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/vendor_ruby/2.0.0
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/vendor_ruby/2.0.0/universal-darwin15
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/vendor_ruby
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin15
/opt/homebrew-cask/Caskroom/rubymine/2016.1/RubyMine.app/Contents/rubystubs20
Sdk Gem paths:
~/.gem/ruby/2.0.0/gems
/Library/Ruby/Gems/2.0.0/gems
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/gems/2.0.0/gems
~/.gem/ruby/2.0.0/bundler/gems
/Library/Ruby/Gems/2.0.0/bundler/gems
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/gems/2.0.0/bundler/gems
Gems used for 'vagrant-wplib-box':
bundler (1.12.3)
/Library/Ruby/Gems/2.0.0/gems/bundler-1.12.3

1
Avatar
Permanently deleted user

Really frustrating bug, but glad I found this thread where other people are experiencing the same thing. I couldn't figure out any good way to fix it so I completely uninstalled RubyMine (http://stackoverflow.com/questions/8297970/how-to-uninstall-rubymine) then reinstalled it. Before I reopened my project, I set the default Ruby interpreter to the one I wanted and then imported my project. It seems to have fixed it.

1

Hello, Mike,

sorry for the delay. Do you have a Gemfile in your project, could you please attach it? What happens if you run 'bundle install' manually from the Terminal using your project Ruby SDK?

0

I'm running into what I believe is the same problem:

/usr/bin/ruby -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) install
-e:1:in `load': cannot load such file -- install (LoadError)
from -e:1:in `<main>'

Process finished with exit code 1

It seems like a recent version of Rubymine (2016.2?) broke the bundler menu actions, but I can't for the life of me figure out what the command should be in the context of Rubymine to make gems install using bundler. I've dug through the preferences to see if there's some path to the bundle command, and can't find anything.

Running bundle install from the shell works flawlessly.

Unfortunately, the bundler menu in RM broke on three different Macs - all of them after one of the recent RM upgrades :(

0

Is there any update on this issue? Just upgraded to 2016.2.2, and still having the problem described.

0

@Alexey That doesn't seem to be it. There's no bundler version specified in the Gemfile. All of the CLI bundler commands work fine. It's Rubymine that has a problem.

It looks like RM is not constructing the bundle command correctly, but I'm not sure what it should be in the context of RM or even where I would reconfigure RM to fix it.

Just updated RM to 2016.2.4, and the problem is still present. Come on JB. A little help?

Here's an example Gemfile:

source 'http://rubygems.org'
gem 'sinatra'
gem 'net-ldap'
gem 'json'
0
Avatar
Permanently deleted user

Is there anything bundler-related in gemspec or Gemfile.lock?

Another guess - RubyMine have cached outdated bundler location somewhere in its settings.  I've updated gemspec and then fixed some files in ~/.RubyMine directory, that fixed described problem for me.

0

I found this happened when I had re-opened a project after some period of time.  I'm not sure if there was an OS update and a JetBrains update but my project environment had changed.  I fixed it by heading to project settings > Modules and then verifying the correct RVM gemset under the Gems tab.

0
Avatar
Permanently deleted user

Hi there, an year later and this bug is still present in RubyMine, so I have opened a bug report here: https://youtrack.jetbrains.com/issue/RUBY-19500

0

Hi,

if a command is skipped in command line it mostly means that it wasn't found in default location. If possible please try to reinstall gems with defaults.

0

Greetings! 

I just ran across this issue and wanted to say Blyang's solution worked for me (thanks, Blyang).  I didn't need to reinstall Rubymine, I just quit the project and set the default interpreter needed by the project.  Once the project was opened again - everything worked as intended.

0
Avatar
Permanently deleted user

This happens when you have bundler dependency in Gemfile or gemspec, that can not be satisfied.  Like "bundler ~> 1.10" but have bundler 1.13 installed.

Obvious fix is to remove or update version specification in Gemfile of gemspec.

-2

请先登录再写评论。