How can I install the YR weather gem? - ruby

I am trying to install the yr.no weather api gem from here but am having problems adding the repository.
I tried gem sources -a http://irbno.rubyforge.org/ but this results in the following error:
Error fetching http://irbno.rubyforge.org/:
bad response Not Found 404 (http://irbno.rubyforge.org/specs.4.8.gz)
I am on Windows XP with Ruby 1.9.2 and have updated to the latest version of Rubygems (1.5.2)
ruby -v returns
`ruby 1.9.2p0 (2010-08-18) [i386-mingw32]`
whilst gem sources -l returns
*** CURRENT SOURCES ***
http://rubygems.org/
http://gemcutter.org
Any thoughts? Is this a problem with the repository or my setup?

The correct URI for the RubyForge RubyGems Repository was http://Gems.RubyForge.Org/, not http://IrBNo.RubyForge.Org/. However, the RubyForge RubyGems repository was shut down a long time ago and migrated to RubyGems.Org, so that URI is now simply a redirect to http://RubyGems.Org/ (as is http://GemCutter.Org/ BTW).
Since you already have that repository URI in your RubyGems sources, you don't need to do anything.
May I ask where you found the information that http://IrBNo.RubyForge.Org/ was the correct URI for the RubyForge RubyGems Repository? You should inform those people that their information is wrong (http://IrBNo.RubyForge.Org/ never was the URI of the RubyForge RubyGems Repository, it always was http://Gems.RubyForge.Org/) and outdated (the default RubyGems Repository moved to http://GemCutter.Org/ and then to http://RubyGems.Org/ a long time ago).
Not that any of this really matters, since as far as I can tell, there was never a Gem released for this project anyway.

Related

GitHub Pages not building

I'm trying to publish an article to my blog on GitHub pages after a few months of absence, and am getting the following error:
Gem::InstallError: public_suffix requires Ruby version >= 2.0.
Installing sass 3.4.20
An error occurred while installing public_suffix (1.5.2), and Bundler cannot
continue.
Make sure that gem install public_suffix -v '1.5.2' succeeds before bundling.
However according to GitHub the Ruby version on GH pages is already > 2.0. Is there some programmatic change that I need to make in my blog's codebase to get this up and running?
This is the corresponding Gemfile:
source 'https://rubygems.org'
# A simple Ruby Gem to bootstrap dependencies for setting up and
# maintaining a local Jekyll environment in sync with GitHub Pages
# https://github.com/github/pages-gem
gem 'github-pages'
Try deleting your gemfile.lock and pull down the last working gemfile.lock file from your GitHub pages repo. (or just checkout the file from an earlier, working commit)
Most of the weird errors stem from the errors with the Gemfile.lock file, which is used to keep track of the versions of each Ruby Gem. Sometimes when running bundle update gems are attempted to be upgraded, which may break compatibility with other gems, at least that's what has happened to me before. Often times running bundle update causes some gems to be downgraded. As a temporary workaround to just get Jekyll to build locally, just revert the file to an earlier version.

When RubyGems hangs

I just had RubyGems not updating for a minute or two on "Fetching gem metadata from http://rubygems.org/".
I'm wondering how to prevent this in the future. Is there a reliable RubyGems mirror which I could specify as an additional source in Gemfile? And would it automatically switch over to the new source after a short timeout?
There is no official mirror. But I discovered that pointing your Gem source to http://production.s3.rubygems.org worked even when I got time-outs from http://rubygems.org

Sinatra Gem install error

I have been trying to install sinatra in a macbook running leopard system, and I am not able to do it.
I get the following error.
MacBook:rubygems-1.3.7 lakshmanan$ gem install sinatra
WARNING: RubyGems 1.2+ index not found for:
http://rubygems.org/
RubyGems will revert to legacy indexes degrading performance.
Bulk updating Gem source index for: http://rubygems.org/
ERROR: While executing gem ... (NoMethodError)
undefined method `gems' for #<Array:0x101901008>
Please help. I reinstalled gems also. Still I get the same error.
rubygems.org does not seem to be responding right now. Try again later. It's probably nothing on your end.

not in gzip format error

while installing any Gem or doing any listing of gem gzip related error comes as shown below:-
C:\Documents and Settings\gangunra>gem install rhosync -v 2.0.0.beta7 --pre
ERROR: While executing gem ... (Zlib::GzipFile::Error)
not in gzip format
C:\Documents and Settings\gangunra>gem list rails -r
*** REMOTE GEMS ***
ERROR: While executing gem ... (Zlib::GzipFile::Error)
not in gzip format
Please help me out how to reslove this
Looks like rubygems.org (or any gem source you have defined) is down.
Not sure if your error was happening in tar_input.rb or ruby_core_source.rb.
Most people solved tar_input.rb error, by cleaning up cache files. I solved the one for ruby_core_source.rb:57 'initialize' : not in gzip format
and here is the description and workaround:
The problem was because "sometimes" the ruby source file in the ftp server is not probably tar + gzip. So sometimes the source file is incorrect.
I just gone through the source code, and the code expects a .tar.gz in the ftp server (e.g. http ://ftp.ruby-lang.org/pub/ruby/1.9/xxx.tar.gz). But the file found was only tar, but not gzip-ed.
The workaround is to modify the code in your gem directory.
I am looking for ppl who knows why the file hosted in ruby-lang.org is not properly gzip-ed. Hope that can solve forever.
Here is the detail description of my finding:
http://ru05team.blogspot.com/2011/08/solving-workaround-initialize-not-in.html
Here is the workaround, source code that you have to change:
https://gist.github.com/1183048
Make sure you are using the right Gem sources.
$ gem sources
should display http://rubygems.org/ as the first source.
If missing, add http://rubygems.org/ as the main source. Otherwise, it might be a temporary issue with RubyGems index.
Also make sure you are using the latest RubyGems (library) version.
$ gem update --system
Find out where your ruby is configured to look for sources:
C:\>gem sources
*** CURRENT SOURCES ***
http://gems.rubyforge.org/
If it is pointed at gems.rubyforge.org (which it is when first installed for older installation binaries) then you’re pointed at the old web server so when ruby tries to get updates it gets an HTTP redirect (302) as a response instead of the expected data in GZIP format. It apparently doesn’t have an error handler configured to detect the redirect so it just gives up.
To fix it you have to update the list of sources. First add the correct source:
C:\>gem sources -a http://rubygems.org/
http://rubygems.org/ added to sources
Then remove the deprecated one:
C:\>gem sources -r http://gems.rubyforge.org/
http://gems.rubyforge.org/ removed from sources
C:\>gem sources
*** CURRENT SOURCES ***
http://rubygems.org/
Next update your ruby system:
C:\>gem update --system
Updating RubyGems
Updating rubygems-update
Successfully installed rubygems-update-1.3.7
:0:Warning: Gem::SourceIndex#search support for String patterns is deprecated
Updating RubyGems to 1.3.7
Installing RubyGems 1.3.7
RubyGems 1.3.7 installed
=== 1.3.7 / 2010-05-13
NOTE:
http://rubygems.org is now the default source for downloading gems.
You may have sources set via ~/.gemrc, so you should replace
http://gems.rubyforge.org with http://rubygems.org
http://gems.rubyforge.org will continue to work for the forseeable future.
...
Note that update verifies that the old source URL is no longer valid…
You should now be able to continue your installation, which in my case was rake.
I ran into this problem when using a network that requires phase 2 authentication. I had forgotten to authenticate in the browser so any web request was redirected to a local authentication page. It would appear that gem does not check whether the response it receives is actually from the actual rubygems.org server (and it's can't based on the address lookup alone unless you used an ssl certificate). Rather than telling you it couldn't reach the real rubygems server, it simply tells you the payload it receives is not in the proper format (zipped). Presumable if you ran a malicious DNS server that redirected rubygems.org to your own service, you could inject anything you wanted into the gems....

Can't install any gems

I have been doing JavaScript and some Erlang for around six months and I haven't done any Rails programming lately. Today on my new PC I went to install Rails but got this error:
gem install rails
WARNING: RubyGems 1.2+ index not found for:
http://gems.rubyforge.org/
RubyGems will revert to legacy indexes degrading performance.
Bulk updating Gem source index for: htp://gems.rubyforge.org/
ERROR: While executing gem ... (Gem::RemoteSourceException)
Error fetching remote gem cache: SocketError: getaddrinfo: The system cannot
find the file specified. (http://gems.rubyforge.org/yaml)
A friend of mine said: "gem -v?" to which I responded "1.3.5". He suggested I update to 1.3.6 but I had the same problem. Then I installed a few gems for testing purposes from github.
I don't know if I'm missing a source or something, or if something changed drastically in gems.
Also:
gem sources -a htp://gemcutter.org/
Error fetching htp://gemcutter.org/:
SocketError: getaddrinfo: The system cannot find the file specified. (http://gemcutter.org/specs.4.8.gz)
For Mac OSX the solution that worked for me was:
sudo gem install rubygems-update --source http://production.s3.rubygems.org/
sudo gem update --system --source http://production.s3.rubygems.org/
It comes from some file on github of all places.
Try reinstalling rubygems from scratch here: http://rubygems.org/pages/download
RubyForge has been deprecated and may no longer be working properly. The other possibility is that when you tried to do this rubyforge or gemcutter was down, or otherwise not accessible over your network. You can also try seeing if you can reach the file on rubygems by entering it in your browser (to test your network): http://gemcutter.org/specs.4.8.gz
This question has previously been asked here: RubyGems 1.2+ index not found for:. It appears the problem was that rubyforge was blocked by China's firewall.
Good luck!

Resources