What should I make out of this message?

0

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

John Doe

Posted 2014-03-28T18:37:16.637

Reputation: 155

Answers

1

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.

Andreas Wiese

Posted 2014-03-28T18:37:16.637

Reputation: 1 911

First of all thanks Andreas. One question after doing this will it be perfectly okay to install rails using "sudo gem install rails" command. What if I have installed Homebrew would it be better to install through Homebrew – John Doe – 2014-03-28T18:52:06.987

I'm not using OS X, thus I don't really know what exactly Homebrew does. Personally I prefer installing Ruby-stuff with gem, but I really can't tell you whether it's the better idea to do so on OS X. :( – Andreas Wiese – 2014-03-28T18:53:45.343

Fine just wanted to know if I go ahead and install using this command "sudo gem install rails" it wont be any issue. – John Doe – 2014-03-28T18:55:20.057