I was trying to install compass on my OS X terminal using the following command:
sudo gem install compass
but an error prompt:
ERROR: Could not find a valid gem 'compass' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - Errno::ECONNREFUSED: Connection refused - Connection refused (https://rubygems.org/latest_specs.4.8.gz) ERROR: Possible alternatives: compass
What's causing this?
I then googled and found the same issue here:
Errno::ECONNREFUSED No connection could be made because
But I don't understand how the following command can resolve the issue:
Try to use environment variables to set the proxies:
export http_proxy="http://user:pass#server.com:port"
export HTTP_PROXY="http://user:pass#server.com:port"
I am only installing compass on my localhost. What should the USER, PASS, and #SERVER be replaced with?
Thank you in advance
I have successfully installed compass now after fixing my proxy via this link:
http://www.cyberciti.biz/faq/linux-unix-set-proxy-environment-variable/
Basically I just did the following commands on the terminal:
$ export http_proxy=http://server-ip:port/
$ export http_proxy=http://127.0.0.1:3128/
Related
I'm trying to install Jekyll on my Windows 10 computer. I have installed Ruby+Devkit successfully and their versions are:
$ ruby -v
ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [x64-mingw-ucrt]
$ gem -v
3.3.3
$ bundle -v
Bundler version 2.3.3
But when I ran any of these commands:
$ gem install jekyll
or
$ gem sources --add https://gems.ruby-china.com/ --remove https://rubygems.org/
or
$ bundle config mirror.https://rubygems.org https://gems.ruby-china.com
$ cd my-jekyll-repo
$ bundle install
or
ridk install
I was prompted with errors all including the message
Net::OpenTimeout: Failed to open TCP connection to localhost:1080 (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. - user specified timeout) (https://gems.ruby-china.com/specs.4.8.gz)
While I have installed Jekyll on other Windows 10 computers successfuly before I've never seen this error. I've searched in many places but couldn't find a solution. I don't understand why it's trying to connect to localhost:1080 but I tried to open the port from the firewall inbound rules as per this instruction and it doesn't work.
So recently I was encountering some SSL cert issues so in order to help fix that, I've upgraded our jruby 1.7.4 to jruby 9.1.15 and our RubyMine to 2018.2.1 (team using Ruby Cucumber).
However, now we're facing an issue installing /updating gems and bundler after the upgrade.
We're trying to install from the command prompt:
$ set HTTP_PROXY=https://username:password#proxyurl.net:port
$ gem install bundler
And receiving the error:
ERROR: While executing gem ... (OpenSSL::SSL::SSLError)
Received fatal alert: protocol_version
Before setting the proxy the error was:
WARNING: Unable to pull data from 'https://rubygems.org/':
SocketError: Failed to open TCP connection to rubygems.org:443
(initialize: name or service not known)
(https://rubygems.org/specs.4.8.gz)
1 gem installed
I've even tried going to a Starbucks to avoid the proxy altogether but am still getting a similar error.
Just to add in trying to install bundler in RubyMine itself doesn't work.
So somehow I fixed it.. I'm not able to reproduce the fix but that might be related to some foundation problems the fix caused.
Basic steps I used (any of these might help):
Removed versions from gemfile
Trying to install bundler from outside proxy
Install bundler through command prompt and install gems through RubyMine
Change gemfile source to 'http' instead of 'https'
Will update more if I find how to reproduce fix
I just installed ruby version 2.3.0p0 using the ruby installer for windows and was trying to install bundler. When I run gem install bundler I get the following error:
Could not find a valid gem 'bundler' (>=0), here is why
Unable to download data from (link removed) rubygems -Errno:ETIMEDOUT:
Failed to open TCP connection to api.rubygems.org:443 (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. -connect(2) for "api.rubygems.org" port 443)(https://api.rubygems.org/specs.4.8.gz)
Some research led me to try running gem install --http-proxy http://[user]:[password]#[server]:[port] which i think might work because I am behind a proxy here and a similiar solution helped me clone a git repository earlier.
But when i tried this command I got the following error:
ERROR: While executing gem ... (Gem:CommandLineError)
Please Specify at least one gem name (e.g. gem build GEMNAME)
UPDATE
So I tried that gem install --http-proxy.... command again with the gem name at the end and I am back to getting the original TCP connection error above. I am pretty sure the login information I entered is correct. I also added --source http://... instead of the https one but still am having the same problem?
1st off your error is pretty telling-
ERROR: While executing gem ... (Gem:CommandLineError) Please Specify
at least one gem name (e.g. gem build GEMNAME)
2nd make sure you have met the requirements for what you're trying to do http://bundler.io/
then run the code..
gem install bundler
bundle init
echo 'gem "rspec"' >> Gemfile
bundle install
bundle exec rspec
In 2023, the best way to install bundler on an old version of Ruby is:
gem update --system
RubyGems and Bundler now ship together, so to get the latest bundler, you should just install the latest RubyGems.
would you try disable ipv6, it had been worked for me
I'm trying to install sass. But not able to install.
Im facing this issue.
C:\Users\Administrator>gem install sass
ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
Errno::ECONNABORTED: An established connection was aborted by the software i
n your host machine. - SSL_connect (https://rubygems.org/quick/Marshal.4.8/sass-
3.4.13.gemspec.rz)
gem sources -a http://gemcutter.org
Error fetching http://gemcutter.org:
Errno::ETIMEDOUT: A connection attempt failed because the connected
party did not properly respond after a period of time, or established conn
ction failed because connected host has failed to respond. - connect(2) (h
tp://gemcutter.org/specs.4.8.gz)
How do I fix this issue?
You can simply put sources into config file in your home directory.
cat ~/.gemrc
---
:sources:
- http://rubygems.org
I got similar message when I tried to install an app. And the problem was that at work my pc was behind a proxy. so, I solved by doing this:
gem install whatever --http-proxy=http://user:pass#proxy:port
http://help.rubygems.org/discussions/problems/799-ruby-gem-install-problems-on-windows-xp