When I run rails s I get a permissions error
Ryans-MacBook-Air-2:fitbet ryankuhel$ rails s
/Users/ryankuhel/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.0/lib/rails/app_rails_loader.rb:37: warning: Insecure world writable dir /Users/ryankuhel/.rvm/gems/ruby-2.0.0-p353/bin in PATH, mode 040777
then I got an error that I needed to run bundle install
Could not find debugger-1.6.1 in any of the sources
Run `bundle install` to install missing gems.
Ryans-MacBook-Air-2:fitbet ryankuhel$ bundle install
Errno::EACCES: Permission denied - /Users/ryankuhel/documents/interactive/fitbet/.bundle/install.log
/Users/ryankuhel/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler- 1.5.1/lib/bundler/vendor/thor/shell/basic.rb:345: warning: Insecure world writable dir /Users/ryankuhel/.rvm/gems/ruby-2.0.0-p353/bin in PATH, mode 040777
Unfortunately, a fatal error has occurred. Please see the Bundler
troubleshooting documentation at http://bit.ly/bundler-issues. Thanks!
/Users/ryankuhel/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/open-uri.rb:29:in `initialize': Permission denied - /Users/ryankuhel/documents/interactive/fitbet/.bundle/install.log (Errno::EACCES)
I am running Max 10.9.1. Any ideas on how to fix this?
If you are running as user ubuntu, you can do sudo chown ubuntu . -R at the application root. This did the trick for me.
Related
I struggled for hours trying to have Assetic with Sass and Compass working on my production server.
The error is:
sh: 1: /root/.rbenv/shims/ruby: Permission denied
This is because my rbenv instalation is under the /root directory so Assetic doesn't have the permision to use it.
I've checked similar issues:
"Rbenv permission denied issue"
"rbenv: Permission Denied"
"Should rbenv be installed system-wide, or at a user level?"
but they didn't help.
I'm using Apache so I guess the default user is "www-data".
As explained in one of the above questions, I tried to grant www-data the permission in /root but either this didn't work or I did it wrong.
sudo chown -R www-data ~/.rbenv
This is the complete error:
[exception] 500 | Internal Server Error | Assetic\Exception\FilterException
[message] An error occurred while running:
'/root/.rbenv/shims/ruby' '/usr/local/bin/compass' 'compile' '/var/www/myapp/app/cache/dev' '--boring' '--images-dir' '/var/www/myapp/app/../web/uploads/img' '--config' '/var/www/myapp/app/cache/dev/assetic_compassu3IAzJ' '--sass-dir' '' '--css-dir' '' '/var/www/formation-hero/app/cache/dev/assetic_compassPbwM3H.scss'
Error Output:
sh: 1: /root/.rbenv/shims/ruby: Permission denied
I'm using Apache on Ubuntu 14.04
# which ruby
/root/.rbenv/shims/ruby
# which compass
/usr/local/bin/compass
# which rbenv
/root/.rbenv/bin/rbenv
# rbenv -v
rbenv 1.0.0-14-gc388331
Symfony 2.7 is installed under /var/www/myapp/
What should I do to either give right to Apache to use the /root repository or, maybe better, how do I install rbenv for my Symfony2 project?
Everything is working fine on my localhost with OS X.
I do not have experience with the said components but assuming that the user who is executing the file is www-data it might be an issue with the permissions of the /root/.rbend/shims/ruby file.
Run the command sudo chmod o+x /root/.rbenv/shims/ruby wich will give execute permissions to the owner of the file, presumably www-data since you ran the chown command.
If it still doesn't work run the command ls -l /root/.rbenv/shims/ruby, the 4th character of the first column should be x, indicating the owner has execution permissions.
For more info on linux file permissions check "Understanding and Using File Permissions".
There is rvm 1.19.6 installed on ubuntu 12.04 with ruby 2.0.0. Just receive permission denied when doing rvm get stable. Here is the error:
$rvm get stable
######################################################################## 100.0%
bash: line 535: /home/ubuntu/.rvm/RELEASE: Permission denied
Could not update RVM, get some help at #rvm IRC channel at freenode servers.
When we are trying to installing readline on the server, the rvm remove 2.0.0 creates the permission deny error:
$rvm remove 2.0.0
tee: /home/ubuntu/.rvm/log/ruby-2.0.0-p0/1367720906_remove.src.log: Permission denied
tee: /home/ubuntu/.rvm/log/ruby-2.0.0-p0/1367720906_remove.src.log: Permission denied
Removing /home/ubuntu/.rvm/src/ruby-2.0.0-p0...........
.........
Error running '__rvm_rm_rf /home/ubuntu/.rvm/rubies/ruby-2.0.0-p0',
please read /home/ubuntu/.rvm/log/ruby-2.0.0-p0/1367720907_remove.rubies.log
rm: cannot remove `/home/ubuntu/.rvm/bin/ruby-2.0.0-p0': Permission denied
Removing ruby-2.0.0-p0 aliases...
Removing ruby-2.0.0-p0 wrappers...
rm: cannot remove `/home/ubuntu/.rvm/wrappers/ruby-2.0.0-p0/ruby': Permission denied
rm: cannot remove `/home/ubuntu/.rvm/wrappers/ruby-2.0.0-p0/rake': Permission denied
rm: cannot remove `/home/ubuntu/.rvm/wrappers/ruby-2.0.0-p0/erb': Permission denied
rm: cannot remove `/home/ubuntu/.rvm/wrappers/ruby-2.0.0-p0/gem': Permission denied
We tried to delete ~/.gem/ and assign the right to ~/.gem/specs following this post, it did not work. What's wrong with the rvm? Thanks for help.
pulling from comments.
rvm was installed as root, and needs to be owned by the ubuntu user (or you need to run all commands as root)
sudo chown -R ubuntu .rvm will fix the permissions errors
as for the ruby 2.0.0#global it doesn't need to be removed. if you look at the rvm documents that is used as a place to install gems that should be across all gemsets for that particular version of ruby for instance I have bond, hirb, wirb, awesomeprint all in my global as they are referenced in my .irbrc. So as I create per project gemsets I always have them available to me (things like bundler are also handy there)
I'm installing redmine and following instructions in their installation page.
when I run the command : bundle install --without development test
I receive this error : Unfortunately, a fatal error has occurred. Please see the Bundler
troubleshooting documentation at http://bit.ly/bundler-issues. Thanks!
/usr/lib64/ruby/1.8/fileutils.rb:243:in `mkdir': Permission denied - /home1/twogupne (Errno::EACCES)
I'm on a bluehost server and I have noted that myhome directory is twohupne not twogupne (as written in the error )
any one can help ?
Perhaps you can try to modify your home's environment variable:
$ export HOME=/home1/twohupne
$ bundle install --without development test
If it doesn't work, have a look at bundle-config and bundle-install
So when I try to install mysql2 I get the following error:
/Users/Koolkrasher/.rvm/rubies/ruby-1.9.2-p180/bin/gem:4: warning: Insecure world writable dir /bin in PATH, mode 040777
Gem files will remain installed in /Users/Koolkrasher/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.3.2 for inspection.
Results logged to /Users/Koolkrasher/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.3.2/ext/mysql2/gem_make.out
All my permissions are good: 755 all the way down from home - bin
I was looking in the wrong path. The bin dir that was world writable was(is) in my export path.
sudo chmod 755 bin did the trick.
Thanks for all the suggestions guys. much appreciated.
I installed Ruby on Rails on my mac today along with Gems and MYsql. I'm trying to follow the lynda.com tutorial and I've run into a brick wall. When I try to run the rails server it doesnt load WEBrick for some reason. This is the error I get:
/Library/Ruby/Gems/1.8/gems/railties-3.0.5/lib/rails/script_rails_loader.rb:11: warning: Insecure world writable dir /usr/local in PATH, mode 040777
/Library/Ruby/Gems/1.8/gems/bundler-1.0.10/lib/bundler/runtime.rb:136: warning: Insecure world writable dir /usr/local in PATH, mode 040777
/Library/Ruby/Gems/1.8/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle: dlopen(/Library/Ruby/Gems/1.8/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib (LoadError)
Referenced from: /Library/Ruby/Gems/1.8/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle
Reason: image not found - /Library/Ruby/Gems/1.8/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle
from /Library/Ruby/Gems/1.8/gems/mysql2-0.2.6/lib/mysql2.rb:7
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.10/lib/bundler/runtime.rb:68:in `require'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.10/lib/bundler/runtime.rb:68:in `require'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.10/lib/bundler/runtime.rb:66:in `each'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.10/lib/bundler/runtime.rb:66:in `require'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.10/lib/bundler/runtime.rb:55:in `each'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.10/lib/bundler/runtime.rb:55:in `require'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.10/lib/bundler.rb:120:in `require'
from /Users/nutanpatel/Sites/simple_cms/config/application.rb:7
from /Library/Ruby/Gems/1.8/gems/railties-3.0.5/lib/rails/commands.rb:28:in `require'
from /Library/Ruby/Gems/1.8/gems/railties-3.0.5/lib/rails/commands.rb:28
from /Library/Ruby/Gems/1.8/gems/railties-3.0.5/lib/rails/commands.rb:27:in `tap'
from /Library/Ruby/Gems/1.8/gems/railties-3.0.5/lib/rails/commands.rb:27
from script/rails:6:in `require'
from script/rails:6
Any ideas on what I could do? Please help - I'm stuck!
I did rails -v and I'm on 3.0.5:
rails -v
/Library/Ruby/Gems/1.8/gems/railties-3.0.5/lib/rails/script_rails_loader.rb:11: warning: Insecure world writable dir /usr/local in PATH, mode 040777
/Library/Ruby/Gems/1.8/gems/bundler-1.0.10/lib/bundler/runtime.rb:136: warning: Insecure world writable dir /usr/local in PATH, mode 040777
Rails 3.0.5
BTW: I tried to go and do this sudo chmod go-w /usr/local/bin but this did not resolve anything.
Reason I did this was because of: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
I strongly urge you to use rvm to install ruby and try again:
http://rvm.beginrescueend.com/
There are a number of issues with the default ruby that ships with OS X. When you install RVM, you can easily get a clean installation of ruby.
Make sure to read the install instructions carefully, especially the last bit about inserting a line into your .bashrc.
This was answered here
Forget the warning: Insecure world writable dir error, that's just a warning from Bundler and has nothing to do with the error that is keeping Rails from starting.
That error is due to the Mysql2 gem not loading properly. I had the same problem. Basically you need the mysql source files for the gem to compile properly. I solved it by installing Homebrew, then installing mysql with Homebrew, then running Bundle install again.
Try this:
install Homebrew
install mysql with hombrew: brew install mysql in a terminal
delete the Gemfile.lock file inside your Rails app
run 'bundle install` again
try starting Rails with this command: bundle exec rails server
I know I'm a little late to this party, but I'm hoping this might help someone else.
You have to set your Gemfile and run bundle install
You do seem to have permissions issues with your gems directory. Try resolving that with:
sudo find /Library/Ruby/Gems/1.8/gems/ -type d -exec chmod 755 '{}' +