Copying gems from previous version of Ruby in rbenv

前端 未结 3 506
难免孤独
难免孤独 2020-12-23 22:46

I installed Ruby 1.9.3-p286 with rbenv. Now, after installing a newer version (p327), obviously, it doesn\'t know anything about the GEMs installed with the previous version

3条回答
  •  别那么骄傲
    2020-12-23 23:01

    You can copy the gems/ and bin/ folders, but this will lead to problems. The files in bin/ have hardcoded paths in them.

    I'd recommend reinstalling them, which would be as easy as this:

    $ rbenv local 1.9.3-p286
    $ gem list | cut -d" " -f1 > my-gems
    $ rbenv local 1.9.3-p327
    $ gem install $(cat my-gems)
    

提交回复
热议问题