I try to install rails but I am faced to the following error.
Has somebody any idea how to resolve it ?
C:\Users\Utilisateur>gem -v
2.0.14
C:\Users\Utilisateur>gem install rails
ERROR: Could not find a valid gem 'rails' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - no such name (htt
ps://rubygems.org/latest_specs.4.8.gz)
C:\Users\Utilisateur>gem install rails --source http://rubygems.org
ERROR: Could not find a valid gem 'rails' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - no such name (htt
ps://rubygems.org/latest_specs.4.8.gz)
Unable to download data from http://rubygems.org/ - no such name (http
://rubygems.org/latest_specs.4.8.gz)
First try to update ruby gems.
gem update --system
The issue most likely is with your internet connection.
If you see this issue again, try
gem install rails --source http://rubygems.org
You can add the not https source permanently like this
gem sources -a http://rubygems.org
Do you want to add this insecure source? [yn]y
I want to give you one more tip:
Don't develop rails on windows. Ruby and rails and many gems are very UNIXy in their ways. Install virtualbox and ubuntu on a virtual machine and run you development for there.
You might have proxy in your system. So use sudo http_proxy=http://host:port gem install rails.
I had the same issue but I ran the "Start command prompt with Ruby" as an administrator and tried the gem install rails and it worked.
I had to run 'gem install' as root to get this to work. I.e. 'sudo', which is less than ideal.
I suspect 'gem' has very poor error reporting and doesn't communicate the real cause from a permissions issue deep down the stack.
In my country for some strange reason rubygems.org domain is blocked. So a vpn was the solution for me.
My problem was I had configured a proxy in my network connection as #theBuzzyCoder said, so I simply changed my connection and it worked, I could install my gem (sass in my case)
Related
I tried all methods of here.
But still, the same error occurs.
An error occurred while installing mysql2 (0.5.2), and Bundler cannot
continue.
Make sure that gem install mysql2 -v '0.5.2' --source 'https://rubygems.org/'
succeeds before bundling.
My spec is:
MacOS Mojave 10.14.1
Ruby 2.5.3p105
Mysql 8.0.12 with Homebrew
Gemfile:
gem "rails"
gem "mysql2", "0.5.2"
Could you kindly tell me a solution?
This is a very good post. I was facing the same issue using mac. What I ended up doing was the following.
I changed the permission for the Gemfile. I used chmod 755 Gemfile.
I used sudo bundle install. This allowed me to install all the gems in the Gemfile.
I did a rake db:create and rails server.
Got things working. Hope it fixes your issue too.
I had the same issue, when setting up a new machine.
Just running
brew install mysql
fixed the failing mysql gem installation for me.
Don't know if this will help, but I had imilar problems on Mac with MySQL twice. First time I just did a complete reinstall, I made sure there were no MySQL files left in the system. I think I followed this guide. The second time I read that it's an issue with symoblic links which I managed to fix with brew prune (I see that it might have been renamed to brew cleanup now - worth to check both).
Mac OSX 10.10.2
Ruby 2.2.0
I'm going through the "One Month Rails" course, and I'm stalling on the part where I need to add bootstrap to the project. I've tried tons of solutions recommended, but nothing seems to work for me.
Here is the error I keep getting:
Gem::RemoteFetcher::FetchError: Errno::ETIMEDOUT: Operation timed out
- connect(2) for "rubygems.global.ssl.fastly.net" port 80
(http://rubygems.org/gems/autoprefixer-rails-5.2.0.gem)
An error occurred while installing autoprefixer-rails
(5.2.0), and Bundler cannot continue.
Make sure that `gem install autoprefixer-rails -v '5.2.0'`
succeeds before bundling.
Things that have failed:
Changing https to http does not work
Bundle update does not work
Restarting the computer does not work
Restarting the Terminal does not work
Please help!
Have you tried to install autoprefixer-rails gem using this command : gem install autoprefixer-rails -v '5.2.0' ? After that try bundle install again.
I finally got it to work, but I'm not sure what it was because.
It was one or more of the following:
I live in China, so I have to use a VPN for many things. I turned my VPN on. This probably wasn't it because the Rubygems website isn't blocked in China and I did try this before.
My XCode was out of date. I had to delete XCode and download it again to get the update.
I turned on root in the terminal with sudo su - before adding autoprefixer with root# gem install autoprefixer-rails -v '5.2.0', as Rick suggested. I'm thinking the root install is what made this work. Yay!
I'm trying to install rails on a new machine and am running to the following command issue:
gem install rails
ERROR: Could not find a valid gem 'rails' (>= 0), here is why:
Unable to download data from http://gems.rubyforge.org/ - Errno::ETIMEDOUT: Operation timed out - connect(2) (http://gems.rubyforge.org/latest_specs.4.8.gz)
rubyforge.org was deprecated in favor of rubygems.org -- quite a while ago, this is nothing new. But you are stuck with an old source, i was too, just updated.
You probably want to do the following, first remove rubyforge.org as a source:
gem source -r http://gems.rubyforge.org
Next add rubygems.org as a source
gem source -a http://rubygems.org
Now do a gem update:
gem update --system
Check to see which version of gem you are running:
gem -v
Should be on 2.0.6 (or greater).
Good to go!
RubyForge was down today. :)
See here.
You could not reach the gems server. Could be many things but you can find the status of RubyForge here: http://status.rubygems.org/
Trying to solve this issue I have a solution telling that using the proxy option when installing gem will help.
I am executing the following line:
sudo gem install rails --http-proxy=http://rubygems.org/
but it give me the same error:
ERROR: Could not find a valid gem 'rails' (>= 0) in any repository
ERROR: Possible alternatives: rails
Could anyone tell what I am doing wrong?
The HTTP proxy isn't rubygems... if you espesify a proxy so... you have to put your own proxy... if you have not proxy... so don't put http-proxy... =)
Do first
REALLY_GEM_UPDATE_SYSTEM=1 sudo gem update --system
sudo gem install rails
In both question -also question from - Ruby is installed by package managers like Synaptic, Aptitude. Debian-like operating systems stricts installation of gems without using package manager. You may use REALLY_GEM_UPDATE_SYSTEM with installation of gems like, but not recommended:
gem install rails REALLY_GEM_UPDATE_SYSTEM=true
Instead of that, you should prefer using RVM or rbenv to get rid of package manager based installation
This is probably very simple question.
Each time I do "Bundle install" in the folder of the project
I get an error like this
An error occured while installing json (1.6.6), and Bundler cannot continue.
Make sure that X succeeds before bundling.
where X can be
'gem install json -v '1.6.6'
or
'gem install execjs -v '1.3.2'
or
'gem install coffee-script -v '2.2.0'
Now, after I gradualy do each gem install manually the bundle install succeeds.
Is there a way to do them all in one command?
is there a way to do it in ruby mine?
That's what Bundler is supposed to do for you.
It looks like you have a problem with your Bundler or Ruby Install somewhere.
Without more information I can only suggest that you checkout the Bundler Troubleshooting page.
I've run into the same problem before if my network connection was an unstable/low bandwidth wireless connection. It tries to install all the gems at once, but stalls on one of them because of the lack of bandwidth. Then you can of course install one at a time maybe, but if your connection keeps going in and out this may be the cause of your inability to install them all at once.
It's possible that some of your gems aren't getting installed due to a bug related to using SSL connections. This would then mean that gems that depend on those gems throw an error like the one you experienced.
See: http://railsapps.github.com/openssl-certificate-verify-failed.html
That link has various workarounds, but the easiest is to replace this line:
source 'https://rubygems.org'
at the top of your Gemfile with this line:
source 'http://rubygems.org'