updating the ruby gem 1.8.5 - ruby-on-rails

hiii
i am trying to update my gem file. Current version of gem is 1.8.5
When i am trying to update it using command " gem install rubygems-update -v 1.8.5 " it is giving following error
**
ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
SocketError: getaddrinfo: Name or service not known
(http://rubygems.org/gems/rubygems-update-1.8.5.gem)
**
I am working on ubuntu 10.04
also i tried to update using command " gem update --system "
it is giving the error as below
Updating rubygems-update
**
ERROR: While executing gem ... (Gem::GemNotFoundException)
Could not find a valid gem 'rubygems-update' (1.8.6) locally or in
a repository
**
i also tried the solution given on the link http://lightyearsoftware.com/2009/07/updating-rubygems-to-recent-1-3-x/
please help me to resolve the problem..

If you are under Windows 7, run the command prompt as Administrator.
Read this thread. The error reported is the same of yours.
Try to apply the Google DNS configuration to your connection.
Otherwise you can try to install locally the gem, downloading it on rubygems.org. After this, in the directory you downloaded the gem, try to install it locally with the command: gem install gem_name --local

I also had this error. I resolved it with
gem uninstall rubygems-update
(you may need to be sudo) and then reinstalled with
gem install rubygems-update
now it's working fine, hope this is helpful

Try this:
Manually uninstall the gem you want to remove: gem uninstall [gemToUinistall]
Download the gem manually from http://rubygems.org/
try to install the gem from local : gem install [gemToInstall]

Related

Error with Bundle Install (Linux)

Upon trying to start a new Rails App on Linux, I am receiving this error:
I am a newbie to this software. Please help!
Thanks :)
My Error
UPDATE: I ran 'sudo gem install bundler', and it worked but now received this error!
'/usr/bin/ruby2.3: No such file or directory -- /usr/bin/bundle (LoadError)'
My new error
It seems like you dont have bundler gem installed.
Try:
gem install bundler
Bundler is missing.
Try the below commands.
[sudo] gem install bundler
bundle install
Try stop using sudo in your commands. According to your new capture, you are using sudo with gem install bundler, and maybe that is conflicting with your configuration.
Take this link for reference for sudo usage with gem
https://stackoverflow.com/a/2119413/4870465

ERROR: Could not find a valid gem 'LocalGem' (>= 0) in any repository

I've done a good search now and I haven't come across anything that quite relates.
I'm trying to install a local decimal to roman numeral gem I compiled myself using bundler to wrap the gem, on a Rails 4 application. I used bundle install with as many different variants in the gemfile as I could find/think of, but the error I get is the single line
ERROR: Could not find a valid gem 'AoifesRoman' (>= 0) in any repository
even using the sudo command wont work.
I used: gem search -l AoifesRoman
and it shows
*** LOCAL GEMS ***
AoifesRoman (0.0.1)
I found a command here http://help.rubygems.org/kb/rubygems/installing-gems-with-no-network
gem install --force --local *.gem
But its for installing a gem on a machine, does anyone think this would work or will it just break something?
Many Thanks
Kindly try this command,
gem install gem_name --source http://rubygems.org
Yes, gem install --local aoifes_roman.gem should work, if you want to install the gem locally, from your local directory.
Then you can reference it in your Gemfile as usual.

ERROR: While executing gem ... (Zlib::GzipFile::Error) not in gzip format

I am trying to execute the command "gem update --system" in my windows command prompt and it shows the error as
Updating rubygems-update
ERROR: While executing gem ... (Zlib::GzipFile::Error)
not in gzip format
When I try to install any gems also with gem install gemname command it is showing the same error message.
Please help. I am executing the command in windows.
I get the same issue with ruby version 1.9.3-p551 downloaded with rbenv on macOS High Sierra and looking for multiple solutions online but none of them work.
However, I notice that when I run
gem sources
The result is
*** CURRENT SOURCES ***
http://rubygems.org/
When I run with ruby version 2.1.9, the result is
*** CURRENT SOURCES ***
https://rubygems.org/
So I remove the http source and use https
gem sources -r http://rubygems.org/
gem sources -a https://rubygems.org/
It works! So I doubt that the http server has problem dealing with gzip encoding. Hope this help for everyone using old ruby version like 1.9.3.
For anybody who is reviving some old app:
I tried downloading GEM from rubygems.org and installing with gem install gemname.gem but it still ended with same err:
ERROR: While executing gem ... (Zlib::GzipFile::Error)
not in gzip format
Adding explicitly --local helped.
gem install --local ~/Downloads/gemname-X.Y.gem
Not going to investigate more, but it was with:
RUBYGEMS VERSION: 1.3.5
RUBY VERSION: 1.8.7 (2013-12-22 patchlevel 375) [i686-darwin18.7.0]
in ASDF environment..with custom compiled openssl 1.0.2
Are you trying to do this at your workplace or school that might be blocking the downloads?
The solution in this question: ERROR: While executing gem ... (Zlib::GzipFile::Error) not in gzip format
Was to download the gems directly from http://rubygems.org/gems, then run the install commands, since it looks locally first.

Problem during SQLite3 installation on Windows XP

As shown in a blog I followed the instructions of setting up SQLite3 on my Windows, but after I pasted the necessary files in Bin folder of Ruby, which I downloaded from http://www.sqlite.org/download.html, I get the following error when I use the following commmands:
C:\gem install sqlite3-ruby --version=1.2.3
ERROR: http://rubygems.org does not appear to be a repository
ERROR: Could not find a valid gem 'sqlite3-ruby' (= 1.2.3) in any repository
Please help me out with this problem and suggest me alternate methods for gem installing SQLite3.
Thanks.
Check that you have the latest version of rubygems: gem -v executed in a command prompt should return 1.3.7. If it does not, you have several options (also explained on rubygems.org):
gem update --system
or
gem install rubygems-update
update_rubygems
Secondly, if you have the correct version and you are on a network with a proxy, you have to tell gem to use that proxy.
There are two ways to do that. First, you could do
gem install sqlite3-ruby -p http://yourproxyserver:port`
or you could define an environment variable
set HTTP_PROXY=http://yourproxyserver:port
and then this setting is saved (and you do not have to specify it explicitly anymore).
Hope this helps.
Try doing this: gem install sqlite3-ruby --version=1.2.3 --source http://gemcutter.org
If that does not work head over to http://gemcutter.org and download the particular version of the gem file, go to the destination to where you copied it to in the command line and install it locally using gem install sqlite3-ruby -l

Ubuntu: "Could not find rails locally or in a repository"

I'm following these instructions to set up Ruby on Rails on my Ubuntu machine. For now at least, I'm planning to use Mongrel.
When I get to this step:
sudo gem install rails
...I get this message:
Bulk updating Gem source index for: http://gems.rubyforge.org/
ERROR: could not find rails locally or in a repository
What should I do next?
I would try to update gems first. The latest version is 1.3.3. You can do this on Ubuntu by either:
sudo gem install rubygems-update
sudo update_rubygems
or
sudo gem install rubygems-update
cd /var/lib/gems/1.8/gems/rubygems-update-*
sudo ruby setup.rb
basically, try again!
It could be a serious error, but in earlier versions ( I encountered this about 1 year ago or so ) it happend on the first try and when trying again the gem would eventually be found. I think it had something to do with the servers performance or such.
Using a recent version of rubygems is probably a good idea, and if it really won't work you can always get the .gem file from sourceforge directly and install from it.
For example with the file rails-2.3.2.gem:
gem install rails-2.3.2 –local
gem install rails --source http://gems.rubyonrails.org

Resources