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

Setting .ruby-version in root directory doesn't work #745

Closed
nagyt234 opened this issue Jun 9, 2015 · 1 comment
Closed

Setting .ruby-version in root directory doesn't work #745

nagyt234 opened this issue Jun 9, 2015 · 1 comment

Comments

@nagyt234
Copy link

nagyt234 commented Jun 9, 2015

I tried to set .ruby-version in root directory to set the default, but it does not work:

root@vmt3:~# rbenv version
system (set by /usr/local/rbenv/version) # BUT THERE IS NO SUCH FILE!!!

root@vmt3:~# cat /usr/local/rbenv/version
cat: /usr/local/rbenv/version: No such file or directory

root@vmt3:~# cat /.ruby-version 
1.9.3-p484

root@vmt3:~# rbenv versions
* system (set by /usr/local/rbenv/version)
  1.9.3-p484
  2.2.2

Rbenv is installed in /usr/local/rbenv/ from the git repository. Ruby 1.9.3-p484 and 2.2.2 are installed, no /usr/local/rbenv/version file exists.

@mislav
Copy link
Member

mislav commented Jun 9, 2015

Thanks for reporting. rbenv currently has a bug discovering the /.ruby-version file in the root directory. To set a global ruby version for the system, however, rbenv wants you to write to /usr/local/rbenv/version (even if it doesn't exist). So, instead of creating a /.ruby-version file in the root directory, which is not advisable since it requires root access to create and change, simply use the command:

rbenv global 1.9.3-p484

You should use rbenv global and rbenv local commands to get or set global/location versions of Ruby instead of writing to files manually.

@mislav mislav closed this as completed in 43b28ca Jun 9, 2015
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

2 participants