RVM install ruby from local source

2019-06-17 03:53发布

问题:

I can't believe the this isn't a more frequently asked question.

I want to install ruby 1.9.2, and I want it as part of my RVM installation. The link for 1.9.2 has since 404'd on the ruby-lang site, so I copied the tar.gz from the ruby github page, rezipped it into a tar.bz2 like rvm requires and dropped it into ~/.rvm/archives

However, every time I call rvm install 1.9.2-p320 it deletes the source tar.bz2 from ~/.rvm/archives and tries to redownload the tar.bz2 from the ruby-lang site.

The --force and --disable-binary options do nothing to prevent the deleting and redownloading attempts.

Is there a way to point rvm explicitly to the source tar.bz2? I'd like to avoid compiling from source myself and then copying the directory into wherever rvm needs it.

Note: It looks like the ruby-lang ftp server is just down for the moment which explains why the download keeps failing, but my question still stands as this seems like good functionality for rvm to have.

回答1:

The deletion of archive is controlled with --verify-downloads flag:

rvm install 1.9.2-p320 --verify-downloads 2 --disable-binary

Values for the --verify-downloads flag:

  • 0 - has to have checksum and must validate
  • 1 - does not have to have checksum, if available must validate
  • 2 - continue even the checksum does not validate


回答2:

The front page of ruby-lang.org does mention that some services would be down, I'd suggest waiting for them to get their services back up and trying again.

http://www.ruby-lang.org/en/news/2013/08/06/status-issue/



回答3:

rvm usage clearly said

rvm [Flags] [Options] Action

The correct syntax for your problem is

rvm --verify-downloads 2 --disable-binary install 1.9.2-p320

rvm will check the flags and options first before executing any action



标签: ruby rvm