开发者

ruby gem --pre list/install, weird error?

开发者 https://www.devze.com 2023-03-01 04:28 出处:网络
rubygems 1.7.2, ruby 1.8.7. linux. I thought this was the way to see what \"pre\" versions of a gem are

rubygems 1.7.2, ruby 1.8.7. linux.

I thought this was the way to see what "pre" versions of a gem are available:

gem list --pre --remote someGem

When I try that though, I get this error message:

*** REMOTE GEMS ***

ERROR:  While 开发者_运维问答executing gem ... (Gem::RemoteFetcher::FetchError)
    bad response Not Found 404
(http://gems.rubyonrails.org/prerelease_specs.4.8.gz)

Anyone know what's up and how to fix it, and/or how I should instead list/install available prerelease gems? I know that gem versions that end in "pre*" and similar things are NOT listed/installed when you don't include "--pre".


Answering my own question, way later, this seems to have been a problem with the default gem sources.

gem sources -l
*** CURRENT SOURCES ***

http://gems.rubyforge.org/
http://gems.rubyonrails.org
http://gems.github.com

Did not include the new http://rubygems.org/. Now somehow it could still install most gems anyway, but not pre-release gems. I thought rubygems updated it's own sources, but apparently not, updating to latest version of rubygems didn't change it's sources.

Odder still, ADDING http://rubygems.org/ did not fix it:

gem sources -a http://rubygems.org/

Still exhibited the problem, as long as those old three were in there. I had to actually REMOVE those old three (which I think is recommended, all we need is http://rubygems.org now, right?)

gem sources -r http://gems.github.com
etc

Then with one and only one source in there, http://rubygems.org, I can now install pre-release gems again, although it does require supplying the "--pre" tag. (It appears when installing via bundler, bundler is happy to install gems with pre-release versions, without a special flag -- but not sure about that).

There still seems to be a problem installing pre-release gems that have dependencies on other pre-release gems. If there's a way to do that, I don't know it. I am not sure if this is a known issue with rubygems or effecting people other than me, or related to some other mis-configuration I have. Also not sure yet if installing via bundler fixes this one.


It seems rubygems can't reach its source. Do:

gem update --system

and retry.

0

精彩评论

暂无评论...
验证码 换一张
取 消