1

In my terminal. When I try to run rails new or rails -v , I get this error message. I have updated my ruby to 2.3.1 and re-installed rails.

/usr/local/bin/rails:22:in `<main>': undefined method `activate_bin_path' for Gem:Module (NoMethodError)
Luka Kerr
  • 4,161
  • 7
  • 39
  • 50
diwao11
  • 151
  • 2
  • 15

2 Answers2

0

In root, I ran gem update --system and then gem install rails. After that I ran rbenv rehash. It worked like a charm.

diwao11
  • 151
  • 2
  • 15
0

If you want to know the reason that this happened, i would guess that your location of ruby on your machine changed. I had ruby installed:

/opt/sensu/embedded/bin/ruby

but when i ran which ruby, I got this back:

/usr/bin/ruby

so when I ran ruby scriptname.rb i got this error:

but when I ran this:

/opt/sensu/embedded/bin/ruby scriptname.rb

The script ran successfully.

I would guess that the location of your ruby got changed, or was unable to be found, but when you updated the system and reinstalled rails, it pointed back to the correct location of your ruby.

mccartjm
  • 121
  • 1
  • 5