Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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!

like image 229
Serik Avatar asked Dec 21 '10 04:12

Serik


2 Answers

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.

like image 60
paxdiablo Avatar answered Nov 14 '22 21:11

paxdiablo


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

like image 25
josh803316 Avatar answered Nov 14 '22 21:11

josh803316