0

~/.rbenv/versions/2.0.0-p247/ exists as does a similar folder for 1.9.3-p429, but nothing for 1.8.7-p374.

What is going on or what am I doing wrong? I have some gems that don't work right with 1.9 and 2.0, so set up 1.8.7-p374 to help debug, but can't install gems.

$ rbenv versions
  system
* 1.8.7-p374 (set by RBENV_VERSION environment variable)
  1.9.3-p429
  2.0.0-p195
$ gem install geonames
ERROR:  While executing gem ... (Errno::EACCES)
    Permission denied - /Users/user_name/.rbenv/versions/1.8.7-p374/lib/ruby/gems/1.8/gems/geonames-0.3.3/.gitignore

I can sudo and install the gem, but I don't know where, and it's not available.

I'm lost in rbenv. Thanks for help.

DMKE
  • 4,553
  • 1
  • 31
  • 50
Greg
  • 2,359
  • 5
  • 22
  • 35

2 Answers2

0

You obviously have set RBENV_VERSION in your environment, e.g. in your ~/.bashrc (look for export RBENV_VERSION=1.8.7-p374), but that particular Ruby version is not installed.

To proceed, first remove that export line and secondly install Ruby 1.8.7 like so:

$ rbenv install 1.8.7-p374
DMKE
  • 4,553
  • 1
  • 31
  • 50
  • Thanks for answering. No .bashrc. Only similar file is .bash_profile which reads `export PATH="/usr/local/bin:/usr/bin:/usr/local/sbin:~/bin:$PATH" eval "$(rbenv init -)" ` – Greg Jul 13 '13 at 02:05
0

Ruby version 1.8.7 generally comes pre-installed with the operating system. That is the reason you do not see it under rbenv's directory

pungoyal
  • 1,768
  • 15
  • 17