1

I installed Rails. While creating a new application with the command:

rails new myapp

The following error messages occur:

Fetching gem metadata from https://rubygems.org/..........
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Installing rake (10.1.0) 
Errno::EACCES: Permission denied - /usr/local/lib/ruby/gems/2.0.0/build_info/rake-10.1.0.info
An error occurred while installing rake (10.1.0), and Bundler cannot continue.
Make sure that `gem install rake -v '10.1.0'` succeeds before bundling.

The version of my gem is 4.0.0.

3
  • can you run gem install rake -v '10.1.0' --trace and post the output here? Commented Jul 15, 2013 at 11:18
  • 2
    Where are you trying to install? Seems like a sudo issue ... Commented Jul 15, 2013 at 11:19
  • Yep, I'll have to agree with @Guy. This seem to be a permission problem. Are you using Ruby that come preinstalled with your system? If so, sudo may be resolve the issue. Commented Jul 15, 2013 at 11:26

4 Answers 4

3

This seems to be permission problem so change the permission of the directory and then try:

gem install rake -v '10.1.0'

and post the logs if an error happens.

Or try:

sudo gem install rake -v '10.1.0'

and then post the logs if there is an error again.

Sign up to request clarification or add additional context in comments.

Comments

1

This is unlikely to be a rake issue, since rake uses the generic gem install mechanism. My guess is that you have permissions screwed up in the gem install directory.

You can do:

gem env gemdir

to see where gems are being installed. Check the permissions in that area to make sure everything is writeable by you.

Comments

0

If you want to avoid sudo to make bundler install the gems into your ~/.gem/ruby/2.0.0 directory, try setting the $GEM_HOME environment variable:

export GEM_HOME="$HOME/.gem/ruby/2.0.0"

Comments

0

This seems to be a bundler issue with the recent versions of rubygems. See https://github.com/bundler/bundler/issues/2445 for details.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.