Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gem::FilePermissionError when using gem_install_uninstall module #113

Open
gunnarmarten opened this issue Dec 14, 2015 · 0 comments
Open

Comments

@gunnarmarten
Copy link

Hi,
I'm getting this file permission error when i try to install a gem during capistrano deployment.
The deployment target is a vagrant VM running OpenSuse 13.2.

executing "/usr/local/rvm/bin/rvm ruby-2.2.3@mt_agent do gem install bundler"
servers: ["127.0.0.1"]
[127.0.0.1:2222] executing command
*** [err :: 127.0.0.1:2222] ERROR:  While executing gem ... (Gem::FilePermissionError)
*** [err :: 127.0.0.1:2222] You don't have write permissions for the /usr/local/rvm/gems/ruby-2.2.3@mt_agent directory.

The file permissions are as follows:
drwxrwsr-x 10 root rvm 4096 Dez 10 11:04 ruby-2.2.3@mt_agent
The deployment user is in the rvm group.

My deploy.rb looks like this (excerpt):


set :rvm_type, :system
require "rvm/capistrano"
require "rvm/capistrano/gem_install_uninstall"


set :user,          ENV['DEPLOYMENT_USER'] || 'deployment'
set :use_sudo,      true
set :environment,   'production'

ENV['GEM'] = "bundler"
after 'deploy:update_code',     'bundle:install'
before 'bundle:install', 'rvm:install_gem' # bundler is no more installed as default gem, make sure we have bundler

I did use cap rvm:install_ruby to install ruby and the gemset.

I googled a bit and look at the code. I ended up adding :with_rvm_group => true to the install_gem/uninstall_gem rvm task in the gem_install_uninstall module as in the create_gemset module to avoid the issue.
Is that a proper fix for this issue? Should I submit a PR? Or is that intended that the rvm_group option is missing in the install_gem task?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant