What should I make out of this message?

Posted on

QUESTION :

I am trying to set up the Ruby on Rails on my Mac OS X Maverick just to check whether I have Rails installed I typed

 rails --version

and I got this as response

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0 /universal-darwin13/rbconfig.rb:212: warning: Insecure world writable dir /usr/local in PATH, mode 040777

Rails is not currently installed on this system. To get the latest version, simply type:

$ sudo gem install rails

You can then rerun your “rails” command.

Should I go ahead and use the install command ? Would It would be safe or there is a better way to do this thing?

Thanks

ANSWER :

What Rails tries to tell you is that your /usr/local directory should not be world-writable (i.e. writable to everyone and every process ever logging in to/running on your system). It’s what the last three digits in 040777 tell you. It’s an octal-number (base 8) representing a bit-mask of permissions where

777
||` permissions for everyone
|`- permissions for group the directory is owned by
`-- permissions for the user the directory is owned by

and

1 - execute permissions (entering for directories)
2 - write permissions
4 - read permissions

7 = 4 + 2 + 1, meaning all permissions for user, group and others (a.k.a. world) set.

You should do chmod 0755 /usr/local to fix the permissions to user-writable only.

Leave a Reply

Your email address will not be published. Required fields are marked *