Insecure world writable dir /usr/local in PATH when trying to install Rails 3.0.3

PermissionsInstallationRuby on-Rails-3

Permissions Problem Overview


I am trying to install rails 3.0.3 and i get the following error every time:

Insecure world writable dir /usr/local in PATH, mode 040777

When I check to see if it installed I get this error:

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:827:in `report_activate_error': Could not find RubyGem rails (>= 0) (Gem::LoadError)
 from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:261:in `activate'
 from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:68:in `gem'
 from /usr/bin/rails:18

Any idea what I am doing wrong? Sorry, I'm a newb!

Permissions Solutions


Solution 1 - Permissions

You need to secure that directory before the install. Use:

chmod o-w /usr/local

to do this. If that doesn't work, the you probably need to be root (or otherwise suitably empowered) so you can try:

sudo chmod o-w /usr/local

and enter your password.

I've seen this sort of thing before on some software which really wants things set up in a certain way to ensure that its assumptions are met. In any case, it's actually a bad idea to have world writable directories except when you know security on them is not a big deal.

/usr/local is important enough that you shouldn't allow anyone to write to it.

Solution 2 - Permissions

For osx it's: sudo chmod -R o-w /usr/local

Solution 3 - Permissions

You will need to run:

sudo chmod o-w -R /usr/local 

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSerikView Question on Stackoverflow
Solution 1 - PermissionspaxdiabloView Answer on Stackoverflow
Solution 2 - Permissionsjosh803316View Answer on Stackoverflow
Solution 3 - PermissionsJai Kumar RajputView Answer on Stackoverflow