0

I tried running a gitproject , https://github.com/jmopr/job-hunter in RubyMine IDE. And while running the project from menu in RubyMine IDE, the error produced is this.

--------------------------(START)-Output for run of project------------

/usr/bin/ruby /Applications/software/projects/gitprojects/job-hunter_rb/bin/rails server -b 0.0.0.0 -p 3000 -e development /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in require': cannot load such file -- bundler (LoadError) from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:inrequire' from /Applications/software/projects/gitprojects/job-hunter_rb/bin/spring:8:in <top (required)>' from /Applications/software/projects/gitprojects/job-hunter_rb/bin/rails:3:inload' from /Applications/software/projects/gitprojects/job-hunter_rb/bin/rails:3:in `'

Process finished with exit code 1

--------------------------(END)-Output for run of project------------

  • Specs:

Ruby Version (ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-darwin16] )

rails -v Could not find proper version of railties (4.2.5.1) in any of the sources Run bundle install to install missing gems.

Ravi Challa
  • 13
  • 1
  • 5

1 Answers1

0

Its seems you are missing the bundler gem which is the gem responsible for installing all other gems.

1) Install bundler first gem install bundler

2) Use bundler to install the other gems, so from the root directory of the project, run bundle install

Hopefully that should sort it out

Brad
  • 8,044
  • 10
  • 39
  • 50
  • I ran two above commands: gem install bundler and bundle install. The error showing is :" Bundler 2 requires Ruby 2.3 or later. Either install bundler 1 or update to a supported Ruby version." But ruby -v gives ruby 2.6. And bundle -v gives Bundler version 1.17.2 – Ravi Challa Jan 29 '19 at 17:34
  • It is possible you have more than one version of ruby on your machine. It may be worth doing a clean install of ruby and getting the latest version. you could alternativley use a version manager like Rbenv. Also if you are running a rails project someone else wrote, you may need to use the ruby version specified at the top of their gemfile or you may run into other issues later on – Brad Jan 29 '19 at 17:38
  • @RaviChalla take a look here: https://stackoverflow.com/a/54068004/2892779 – Jay Dorsey Jan 30 '19 at 01:13
  • @JayDorsey Bundle version changed to 1.17.3 . – Ravi Challa Jan 31 '19 at 13:34
  • And when I tried to run project in RubyMine, "No Rails found in SDK" error popped. so ran "sudo gem install rails",that solved that issue but ,opened issue " Could not find capybara-webkit-1.10.1 in any of the sources" – Ravi Challa Jan 31 '19 at 13:42
  • If you have run bundler but rubymine is saying you are still missing all these gems I would think that this is again related to having more than one ruby version and Rubymine is configured to use the wrong SDK. Go into preferences and under Languages & Frameworks, then Ruby SDK and Gems and make sure the correct version of ruby is selected – Brad Jan 31 '19 at 14:57
  • 1
    @RaviChalla the fact that you had to (or chose to) use `sudo` to call gem install means you're probably usualy system ruby, rather than a version from a ruby version manager (rvm, rbenv, asdf-ruby). You definitely want to take the time to choose one, set it up, and configure it correctly. Using system ruby to install gems and manage your ruby version is going to cause more headaches than setting up a version manager. My preferred is asdf/asdf-ruby, but lots of people like rvm & rbenv also. – Jay Dorsey Jan 31 '19 at 15:23