I'm trying to deploy a rails app to my Ubuntu server. I already installed rvm
and right now I'm trying to use bundler
in order to deploy my app.
However I'm getting this:
/usr/local/rvm/rubies/ruby-1.9.3-p374/lib/ruby/1.9.1/fileutils.rb:247:in `mkdir': Permission denied - /myroot/repos/myapp/.bundle (Errno::EACCES)
First, What user is executing the whole rvm
commands? I mean I have rake
, bundle
etc, in my path, but I don't know exactly which user is executing them.
As a first intent I tried changing the permissions for all the files inside /myapp
folder. Giving them root:rvm
, but no luck.
Now if I try to run the bundle command as sudo
(or in fact any ruby command) I'm getting errors similar to this one:
/usr/local/rvm/gems/ruby-1.9.3-p374@global/bin/ruby_noexec_wrapper
So, a little explanation of what the wrapper is and why is it not finding ruby would help me a lot to understand this kind of error.
It is recommended to not use sudo
for rvm
, ruby
and any RubyGems installed commands as sudo
by default losses environment variables used to configure RVM / Ruby / RubyGems.
If you really need to use sudo
- go with rvmsudo
- but I need to warn you it elevates privileges exposing your system, it's a security risk.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.