Search code examples
ruby-on-railsrbenv

Rails Gem install fails after Rbenv


So when I run:

$ rails new mywebapp

I get the following error:

Your user account isn't allowed to install to the system Rubygems.

This is despite installing rbenv via Homebrew.

I have added the following to ~/.bash_profile

eval "$(rbenv init -)"

And installed a version of Ruby.

Running:

$ echo $PATH

Gives me:

/Users/myusername/.rbenv/shims:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

Im not sure where to go from here. Hoping someone can help.

Many thanks.


Solution

  • Based on the comments to the original question, the answer was that the system-installed rails executable was being used instead of the rbenv version. The fix was to run:

    gem install rails