Problems with Rubygems when starting rails new

Sorry, this may be the main question, but I'm new to rails. I wanted to launch a new rails project with a team rails new projName. In the middle of the process, I received the following message:

run  bundle install

Your user account isn't allowed to install to the system Rubygems.
You can cancel this installation and run:

bundle install --path vendor/bundle

to install the gems into ./vendor/bundle/, or you can enter your password
and install the bundled gems to Rubygems using sudo.

Password:

I was not sure whether I should indicate my password, but I searched and I found it safe to do this (or what I understood).

In the end, I received this warning:

Warning: You're using Rubygems 2.0.14 with Spring. Upgrade to at least Rubygems 2.1.0 and run `gem pristine --all` for better startup performance.
* bin/rake: spring inserted
* bin/rails: spring inserted

so I tried to run gem install Rubygemsand I got:

ERROR:  Could not find a valid gem 'Rubygems' (>= 0) in any repository
ERROR:  Possible alternatives: ruby_gem, ruby_gem_eg, ruby-rets, ruby-gen, rubyless

I tried gem install rubygems-updateand I got:

ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.

I already installed the rails through RVM, and I'm not sure why I am having these resolution problems. Since I have no experience with precious stones, I am stuck and do not know how to fix these problems.

+4
3

, .

:

  • gem env. GEM PATHS :

    /Library/Ruby/Gems/2.0.0

    /Users/sam/.gem/ruby/2.0.0

    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/gems/2.0.0

  • ~/.bashrc :

    export GEM_HOME =/Library/Ruby/Gems/2.0.0

    export PATH = $PATH: $GEM_HOME:/Users/sam/.gem/ruby/2.0.0:/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/gems/2.0 +0,0

  • gem install rubygems-update. sudo.

+4

a:

gem update --system

Rubygem .

+8

Try sudo gem install rubygems-update

+4
source

All Articles