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.

有帮助吗?

解决方案 2

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

其他提示

Agreeing with Dylan on the problem, I think that the best solution is to set explicitly an Rbenv global version using rbenv global 2.1.1 And then reinstalling bundler on that version.

gem uninstall bundler gem install bundler rbenv rehash

This worked good for me. Hope it helps.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top