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

rvm can't install if user home directory contains @ symbol #3790

Closed
sylvainsf opened this issue Oct 27, 2016 · 22 comments · Fixed by #5221 · May be fixed by #4832
Closed

rvm can't install if user home directory contains @ symbol #3790

sylvainsf opened this issue Oct 27, 2016 · 22 comments · Fixed by #5221 · May be fixed by #4832

Comments

@sylvainsf
Copy link

sylvainsf commented Oct 27, 2016

Description

If user's home directory contains an @ symbol rvm fails to install any rubies.

Environment info

  • RVM version: 1.27.0
  • Operating System: MacOS
  • Version/Release: 10.12 Sierra
  • Shell: zsh

Expected behavior

rvm install ruby-2.2.0 should install ruby.

Actual behavior

Note: User home directory is /Users/sylvain.niles@alaskaair.com but in output below you can see it's attempting to modify directories that do not exist.

rvm install ruby-2.2.0
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.12/x86_64/ruby-2.2.0.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Certificates in '/usr/local/etc/openssl/cert.pem' are already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/sylvain.niles@alaskaair.com/.rvm/rubies/ruby-2.2.0, this may take a while depending on your cpu(s)...
ruby-2.2.0 - #downloading ruby-2.2.0, this may take a while depending on your connection...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 12.6M  100 12.6M    0     0  2797k      0  0:00:04  0:00:04 --:--:-- 2909k
ruby-2.2.0 - #extracting ruby-2.2.0 to /Users/sylvain.niles@alaskaair.com/.rvm/src/ruby-2.2.0 - please wait
ruby-2.2.0 - #applying patch /Users/sylvain.niles@alaskaair.com/.rvm/patches/ruby/2.2.0/fix_installing_bundled_gems.patch - please wait
ruby-2.2.0 - #applying patch /Users/sylvain.niles@alaskaair.com/.rvm/patches/ruby/2.2.0/openssl3.patch - please wait
ruby-2.2.0 - #configuring - please wait
ruby-2.2.0 - #post-configuration - please wait
ruby-2.2.0 - #compiling - please wait
ruby-2.2.0 - #installing - please wait
ruby-2.2.0 - #making binaries executable - please wait
ruby-2.2.0 - #downloading rubygems-2.4.8
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  437k  100  437k    0     0   680k      0 --:--:-- --:--:-- --:--:--  679k
ruby-2.2.0 - #extracting rubygems-2.4.8 - please wait
ruby-2.2.0 - #removing old rubygems - please wait
ruby-2.2.0 - #installing rubygems-2.4.8 - please wait
mkdir: /Users/sylvain.niles@global/bin: Permission denied
mkdir: /Users/sylvain.niles@global/cache: Permission denied
ruby-2.2.0 - #gemset created /Users/sylvain.niles@global
ruby-2.2.0 is not installed.
To install do: 'rvm install ruby-2.2.0'
ruby-2.2.0 is not installed.
To install do: 'rvm install ruby-2.2.0'

Steps to reproduce

  1. Create user with home directory containing @ symbol
  2. Install rvm
  3. Attempt to install any version of ruby.
@sylvainsf
Copy link
Author

@pkuczynski I'm not convinced it's macos specific, but don't have a linux instance to test on at the moment.

@sylvainsf
Copy link
Author

If anyone can point me to where home directory is parsed/used I may be able to figure out a fix. I couldn't quite figure out where in the code on my own.

@Defilan
Copy link

Defilan commented Nov 28, 2016

I've run into this too. When using a company Mac that uses an e-mail address as the username, it breaks for me too. I was forced to use a non-compliant username to bypass this issue. It is currently preventing a rollout in my org.

@pkuczynski pkuczynski self-assigned this Nov 29, 2016
@pkuczynski pkuczynski added the bug label Nov 29, 2016
@pkuczynski pkuczynski added this to the rvm-1.28.0 milestone Nov 29, 2016
@Zipfer
Copy link

Zipfer commented Dec 14, 2016

I have the same issue. How can I just workaround it?

@sylvainsf
Copy link
Author

@Zipfer I just moved my home directory to a non @ symbol named directory but that was a big pain to do.

@nkirschbaum
Copy link

+1 I'm having the same "@" issue

@pkuczynski pkuczynski modified the milestones: rvm-1.28.0, rvm-1.29.0 Dec 19, 2016
@pkuczynski pkuczynski modified the milestones: rvm-1.29.0, rvm-1.30.0 Feb 14, 2017
@pkuczynski pkuczynski modified the milestones: rvm-1.29.2, rvm-1.29.4 Sep 19, 2017
@bradwilliamson
Copy link

I am having this issue on RHEL 7

@jeanlange
Copy link

Having this issue on MacOS High Sierra (10.13.4)

@Ramyashanthaa
Copy link

Iam using MacOS High Sierra (10.13.4) too. My username doesn't have "@".how to resolve the issue?

@pkuczynski pkuczynski modified the milestones: rvm-1.29.4, rvm-1.29.5 Sep 23, 2018
@pkuczynski pkuczynski modified the milestones: rvm-1.29.5, rvm-1.29.7 Dec 12, 2018
@pkuczynski pkuczynski modified the milestones: rvm-1.29.7, rvm-1.29.8 Jan 3, 2019
@pkuykendall
Copy link

I am also having this issue on RHEL 7.

@pkuczynski pkuczynski modified the milestones: rvm-1.29.8, rvm-1.29.9 May 8, 2019
@tadas-s
Copy link

tadas-s commented May 16, 2019

Having this issue on Ubuntu 18.04, RVM 1.29.8 .. User names in our developer machines include @ sign between actual user name and domain user belongs to.

@pkuczynski pkuczynski modified the milestones: rvm-1.29.9, rvm-1.29.10 Jul 10, 2019
@islamaskar
Copy link

islamaskar commented Nov 12, 2019

Sorry any update regarding this

@pkuczynski
Copy link
Member

Not really. No time to work on this I am afraid :( But a PR is welcome

@skoblenick
Copy link

This also happens in Linux when using SSSD. The user's home directories are created as user@example.com. Installation of rvm fails with mkdir: cannot create directory '/home/user@global': Permission denied

@sourabhpat
Copy link

mkdir: /Users/user.name@global/bin: Permission denied
mkdir: /Users/user.name@global/bin: Permission denied

Any update on this? Facing same issue. Really need help

Thanks in advance.

@raelgc
Copy link
Contributor

raelgc commented Dec 16, 2019

It appears to be affecting Ubuntu too: #4776.

@priyankshah217
Copy link

I am also facing the same issue.

@sourabhpat
Copy link

I have done these things and everything is working fine now.

Here is the solution for the same

cd /Users;
ln -s "<email_id / current username>" <new_name_home>; 
export HOME=/Users/new_name_home;
add to bash profile; 
curl command to install rvm; 
add .rvm scripts to path in bash_profile; 
source rvm; 
rvm install "ruby-2.5.5";

@pkuczynski pkuczynski modified the milestones: rvm-1.29.10, rvm-1.29.11 Mar 25, 2020
@MichaelRo
Copy link

Same problem here

@pkuczynski pkuczynski modified the milestones: rvm-1.29.11, rvm-1.29.12 Dec 29, 2020
@pkuczynski pkuczynski modified the milestones: rvm-1.29.12, rvm-1.29.13 Jan 15, 2021
@GroveIV
Copy link

GroveIV commented Jan 31, 2022

Also having this problem

@jamesiarmes
Copy link
Contributor

I believe I've identified the issue here. There are multiple places where rvm attempts to determine paths by removing the gemset from an existing path, if it exists. However, it blindly removes everything from the gemset separator (@) to the end of the string. I've opened #5221 which I can confirm allows rubies to be installed and gemsets to be created when your home directory includes the separator as a character. There may be more places where this logic needs to be updated, but this has addressed my immediate issue.

In the process of looking into this I attempted to override the separator, but this didn't work either. There are a number of places where the separator is hard coded to "@" rather than using the rvm_gemset_separator variable. I have not addressed this additional issue in the PR.

jamesiarmes added a commit to jamesiarmes/rvm that referenced this issue May 18, 2022
pkuczynski pushed a commit that referenced this issue Feb 18, 2023
…or (#5221)

Co-authored-by: Mathieu Jobin <99191+mathieujobin@users.noreply.github.com>
Fixes #3790
havenwood pushed a commit to havenwood/rvm-1 that referenced this issue Apr 26, 2024
…or (rvm#5221)

Co-authored-by: Mathieu Jobin <99191+mathieujobin@users.noreply.github.com>
Fixes rvm#3790
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment