Connor Leech
Connor Leech

Reputation: 18873

chmod a rails directory in ubuntu, now asked run or display contents

I was trying to fix a Errno::EACCES (Permission denied) error (found the correct answer here but in the process I ran chmod -R 777 /home/user/myRailsApp

The next time I commited I got all these mode changes

$ git commit -m "path, url"
[master 9bd6359] path, url
 34 files changed, 7 insertions(+), 4 deletions(-)
 mode change 100644 => 100755 .gitignore
 mode change 100644 => 100755 Gemfile
 mode change 100644 => 100755 Gemfile.lock
 mode change 100644 => 100755 README.md
 mode change 100644 => 100755 README.rdoc
 mode change 100644 => 100755 Rakefile
 mode change 100644 => 100755 app/assets/images/.keep
 mode change 100644 => 100755 app/assets/javascripts/application.js
 ...

now also any time I open a file in that directory I'm asked "Do you want to run "item.rb", or display its contents?". I'm running Ubuntu 12.04

Can I undo my chmod, set things back to normal? (Also is this mode change a problem for heroku?)

Upvotes: 1

Views: 1512

Answers (1)

ksu
ksu

Reputation: 608

I guess you don't want execute permissions on the files, only on the folders.

To make write/read only you can

chmod -R 666 /home/user/myRailsApp

Now to set execution permission to all folders you can type

find /home/user/myRailsApp -type d -exec chmod 777 {} \;

This will set execution permission only to the folders and subfolders but not to the files.

Upvotes: 1

Related Questions