How to install Rails through a proxy - ruby-on-rails

I was trying to install Ruby on Rails onto my PC, when I got this error:
gem install rails - ERROR: While executing gem (Net::HTTPServerException) 407 “Proxy Authentication Required” [on hold]
I tried:
gem install --http-proxy http://{domain}%5C{username}:{password}#{proxy.address}:{port}/ rails
got the error in the title
I also tried:
gem install -p http://pynewbie:mypassword#the-proxy-host.com:8888 rails
and got the error
ERROR: Could not find a valid gem 'rails' (>= 0), here is why: Unable to download data from https://rubygems.org/ - no such name(https://rubygems.org/specs.4.8.gz)

better to use proxychains to proxy all requests inside your command:
proxychains gem install rails
after install you have to create configuration file on ~/.proxychains/proxychains.conf
proxychains github

Related

gem calls always timeout (can't reach rubygems.org)

I have a new install of Ubuntu 18.04. I am trying to install everything I need for Ruby on Rails, but whenever I use the gem command I get a timeout error, like this:
chris#linuxbox:~/Sites$ gem install bundler
ERROR: Could not find a valid gem 'bundler' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - timed out (https://api.rubygems.org/specs.4.8.gz)
But if I paste that URL into my browser, I get the file right away!
Why can't I connect from the command line?

uglifier gem load error / download node.js?

I am getting started with Ruby on Rails, and following the steps at InstallRails... I have created the sample_app on the desktop, and now I cannot create the server.
My command
$ rails server
is answered with the following
...There was an error while trying to load the gem 'uglifier'. etc
I have read several threads here and elsewhere, such as this one and this one... In the latter there seems to bea solution, which I can't understand.... I cannot download node.js! or nodejs? What is my command and directory in Gitbash to download it?
It requires JS runtime.
Just install gem therubyracer for the JS runtime.
In the default rails Gemfile,uncomment the line for the gem 'therubyracer' which is commented out.If you dont find it add the gem to your Gemfile like
gem 'therubyracer'
Then run
bundle install
The gem will be installed and it should work.
Otherwise you can install node.js.
For ubuntu
sudo apt-get install nodejs
For mac
brew install nodejs

updating the ruby gem 1.8.5

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]

Missing these required gems: troelskn-handsoap SOAP Client

I followed the instructions in the Handsoap wiki.
However, when I try to run my application I get this error:
Missing these required gems:
troelskn-handsoap
And if I run:
gem install troelskn-handsoap
I get:
ERROR: Could not find a valid gem
'troelskn' (>= 0) in any repository
What am I missing?
Thx.
The gem has been renamed - It's now simply named handsoap. Install it from gemcutter:
gem sources -a http://gemcutter.org
sudo gem install handsoap curb nokogiri
The canonical repository for Handsoap is now on https://github.com/unwire/handsoap

Gem repository not found when installing rails

I have Ruby 1.8.7 and Ruby 1.9.2 installed on my Windows Machine.
In my console when I do ruby -v it gives me Ruby 1.8.7
Now when I try
gem install rails -v 2.3.8
I get this error
ERROR: http://gems.rubyforge.org/ does not appear to be a repository
ERROR: could not find gem rails locally or in a repository
My RubyGems version show 1.3.5 so I tried to update it
gem update --system
I get this error
Updating RubyGems
ERROR: http://gems.rubyforge.org/ does not appear to be a repository
ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
Errno::E10013: An attempt was made to access a socket in a way forbidden by
its access permissions. - connect(2) (http://gems.rubyforge.org/yaml)`
What is going wrong?
Give this a try.
gem sources
That will show you what sources you are using.
gem sources -a http://rubygems.org
gem sources -a http://gems.github.com
gem sources -a http://gems.rubyforge.org/
Those will add the most used gem sources.
I got the same error, but when I tried to set the company's proxy with SET HTTP_PROXY, I got a problem because the proxy uses NTLM validation and I needed to specify my AD-Domin which won't work wit gem. The way I got around it was installing fiddler and starting it and then setting
SET HTTP_PROXY=http://localhost:8888
afterwards my gems installed like a charm!

Resources