Sinatra Gem install error - ruby

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.

Related

How to fix "uninitialized constant Gem::GEM_PRELUDE_SUCKAGE" in RubyGems tasks

My RubyGems isn't working, throwing an error which goes as follows, triggering (nearly) on any Gem task:
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems.rb:1081:in `<top (required)>': uninitialized constant Gem::GEM_PRELUDE_SUCKAGE (NameError)
from <internal:gem_prelude>:1:in `require'
from <internal:gem_prelude>:1:in `<compiled>'
I'm new to Ruby / RubyGems / installing Ruby and all I know is that an uninitialized constant is essentially a undefined variable. It could also be possible that it's something with Ruby itself, although the ->Gem:GEM<-_PRELUDE_SUCKAGE points me to RubyGems.
In a nutshell, I installed a bunch of Ruby things (think RVM, rbenv, etc.) to develop Ruby on Rails, as I thought it would be a good way to learn Ruby.
Well, after going through a long and tedious process to upgrade Ruby to 2.6.3, then downgrade to 2.5.5 and then 2.4.0, then back up to 2.5.5 and solving downgrade issues, RubyGems throws the error. I settled on 2.5.5 because 2.6.3 caused errors and 2.4.0 was too early of a version.
It's causing all sorts of errors, like HAML not compiling and Rails not making a controller. I really don't know what's happening.
If I run gem install [gem name], it throws the error. Running rails generate controller [name] index (for those not familiar to Rails this creates, well, a controller) it throws the error. Doing anything really with the gem command causes the error, except for gem server.
If I upgrade back up to the latest Ruby version, I fear that my gem command will go all wonky again and I'll have to go through another day of troubleshooting versions. How do I fix this, or at least get rid of the message so I can create things again?
I had this happen to me just today. It seems, somehow, my ruby version had been corrupted. When I ran rvm list version 2.5.1 was listed as 'broken'. I had to uninstall 2.5.1 fully (using sudo even in my case) to get to a clean slate.
Then, when attempting to reinstall, rvm was giving me all kinds of grief after a new gpg key which I initialy couldn't get to install properly (hint).
After a clean wipe of ruby 2.5.1, updating rvm to latest version and reinstalling, I got this error: Error running 'env GEM_HOME=/ruby-2.5.1#global GEM_PATH= /Users/user/.rvm/rubies/ruby-2.5.1/bin/ruby -d /Users/user/.rvm/src/rubygems-3.0.8/setup.rb --no-document',.
It appears that an update to MacOSX deprecated a version of OpenSSL which causes some issues. I ended up following this thread and ran rvm gemset create global --default and then bundle install to get passed the Gem errors.
Honestly, rails is supposed to be easier than this. I wish docker was easier to reason about sometimes. These are the kinds of issues docker supposedly promises to fix eh?

Ruby Shoes App, Gem Chef: bad response Not Found 404

I'm trying to write a Shoes app that will call Chef classes and modules. To accomplish this, I'm using Shoes 3.2.21-gtk2 and using the following code before my Shoes app code:
Shoes.setup do
gem 'chef'
end
Shoes.app do
...
end
When I run the app from Shoes, it attempts to install chef, and even determines the latest version (12.0.3) however, I get the following error during the installation:
bad response Not Found 404 (https://rubygems.global.ssl.fastly.net/quick/Marshal.4.8/pry-0.10.1-x86-mingw32.gemspec.rz)
This version of Shoes is using Ruby 2.1.5-p273, which satisfies the minimum requirement of the Chef gem: https://rubygems.org/gems/chef
Is there some bug in Shoes with its ssl code? Or am I missing something else?
I got this error too.
The error occurs when trying to install the "pry gem". In my case was a bug that happened in my old version of rubygems (2.4.6).
FIX:
1 - Install another version of rubygems
gem update --system 2.4.4
2 - Install pry
gem install pry
The error also happens with the 2.4.5 version of rubygems: https://github.com/rubygems/rubygems/issues/1120

Ruby gems installation error

When I am trying to install a gem or run anything with gem command, I see this warning,
Error loading RubyGems plugin "/Users/ender/.rvm/gems/ruby-1.9.3-p194#global/gems/rubygems-bundler-0.9.0/lib/rubygems_plugin.rb": undefined method `first' for #<String:0x007ffedc0964f0> (NoMethodError)
I searched it but I could not find anything out.
What is the problem and how can I fix it?
Note: I cannot install any gems.
Thanks.
Try removing the /Users/ender/.rvm/gems/ruby-1.9.3-p194#global/gems/rubygems-bundler-0.9.0 directory. There seems to be a problem with this gem.

How can I install the YR weather gem?

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.

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