Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9213227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:41:48+00:00 2026-06-18T01:41:48+00:00

I installed Ruby 1.9.3-p286 with rbenv. Now, after installing a newer version (p327), obviously,

  • 0

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.

Is it possible to copy Gems from that version to the newer one, so that it won’t be needed to download them all again?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T01:41:50+00:00Added an answer on June 18, 2026 at 1:41 am

    I’ve been looking at this specifically from the perspective of upgrading and reinstalling without downloading. It’s not trivial, and I recommend you do some cleanup of your gems to minimize the amount of processing/installation that needs to be done (e.g., I had five versions of ZenTest installed; I did ‘gem cleanup ZenTest’ before doing this). Be careful with ‘gem cleanup’, though, as it removes all but the LAST version: if you need to support an older version of Rails, manually clean up the versions you don’t need.

    I called this script ‘migrate-gems.sh’:

    #! /bin/bash
    
    if [ ${#} -ne 2 ]; then
      echo >&2 Usage: $(basename ${0}) old-version new-version
      exit 1
    fi
    
    home_path=$(cd ~; pwd -P)
    old_version=${1}
    new_version=${2}
    
    rbenv shell ${old_version}
    
    declare -a old_gem_paths old_gems
    old_gem_paths=($(gem env gempath | sed -e 's/:/ /'))
    
    rbenv shell ${new_version}
    
    for ogp in "${old_gem_paths[@]}"; do
      case "${ogp}" in
        ${home_path}/.gem/ruby*|*/.gem/ruby*)
          # Skip ~/.gem/ruby.
          continue
          ;;
      esac
    
      for old_gem in $(ls -1 ${ogp}/cache/*.gem); do
        gem install --local --ignore-dependencies ${ogp}/cache/${old_gem}
      done
    done
    

    There are three pieces that make this work:

    1. gem env gempath contains the paths (:-separated) where gems are installed. Because
      gems are shared in ~/.gem/ruby, I skip this one.
    2. gem install accepts --local, which forces no network connections.
    3. gem install accepts --ignore-dependencies, which disables dependency checking.

    I had a fairly large list of gems to move over today and I didn’t want to download from rubygems.org (plus, I needed older versions), so I whipped this up fairly quickly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been having some problems installing Ruby 1.9.3 (or any version after 1.8.7 for
I have installed Ruby 1.9.2 along with installing the rails gem. I have now
I've installed ruby-1.9.2-p290 using ruby-build. I used the command ruby-build 1.9.2-p290 ~/.rbenv/versions/1.9.2-p290 Now, How
After I installed a version of ruby with rvm, I noticed that some minor
I installed ruby 1.9.3 w/ rubyinstaller-1.9.3-p194.exe, and then installed RubyMine right after, as per
I installed Ruby 1.9.3 and also installed vmc successfully as per instructions at http://docs.cloudfoundry.com/tools/vmc/installing-vmc.html
I have just installed Ruby 1.9.3 on my Windows 7 PC. Now I am looking
I have installed Ruby 1.9.3-p327 and I can use it and my .rvmrc file
I previously had ruby 1.9.3-p286 installed with rvm (set as --default ). I had
I installed ruby 1.9.3 thru RVM, and now want to get the rekyll gem

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.