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

My path isn't working? #936

Closed
vennsoh opened this issue Oct 3, 2016 · 4 comments
Closed

My path isn't working? #936

vennsoh opened this issue Oct 3, 2016 · 4 comments

Comments

@vennsoh
Copy link

vennsoh commented Oct 3, 2016

Hi gang,

I tried to follow the guides for installing rbenv but in vain.

Conditions:
I don't have full admin rights to my Mac machine.

Steps:

  • Install rbenv.
  • Install Ruby-build.
  • Install Ruby. rbenv install 2.3.1
  • rbenv global 2.3.1

My .bash_profile:
export PATH="$HOME/.rbenv/bin:$PATH"

However when I try to run $ gem install scss_lint
It is still pointing to the system ruby path environment? Why?

$ echo $PATH
/Users/eevenn.soh/.rbenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

I can see the path is there.

Error:
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.

$ gem env home
/Library/Ruby/Gems/2.0.0 <-- How to change this?

@vennsoh
Copy link
Author

vennsoh commented Oct 3, 2016

export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"

Okay, I have fixed it.
Need this extra one line of bad boy
eval "$(rbenv init -)" <-- If only the guide make it clearer (:

By saying: .bash_profile needs to contain:
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"

@mislav
Copy link
Member

mislav commented Oct 3, 2016

@vennsoh Glad you solved it!

@mislav mislav closed this as completed Oct 3, 2016
@rcrogers
Copy link

rcrogers commented Feb 15, 2017

I got this too. It's confusing that running rbenv init merely gives instructions for initializing rbenv but does not actually initialize it.

@pitosalas
Copy link

On ubuntu .bash_profile isn't run. So I put those lines at the end of .bashrc:

export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"

and still:

pitosalas@ubuntu:~$ which ruby
/home/pitosalas/.rbenv/shims/ruby
pitosalas@ubuntu:~$ which gem
/home/pitosalas/.rbenv/shims/gem
pitosalas@ubuntu:~$ gem env home
/var/lib/gems/2.3.0
pitosalas@ubuntu:~$ 

In other words, gem's home is not set right, and so I cannot install gems without sudo (which I don't want to do.)

I know I can hack this, but I want to give working instructions to my students, so it would be great to see what I did wrong to get to this spot. Thanks!

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

4 participants