Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not find a valid gem 'mysql2-0.3.18.gem'

i am new to Ruby on rails and i have facing this problem during Rails installation. I have searched a lot and tried many solution which were available on stackoverflow but nothing work for me. Please help how can i get out of this problem.. enter image description here

like image 397
Rana Zubair Avatar asked Mar 03 '15 14:03

Rana Zubair


2 Answers

I have had this problem before, and the reason you are getting this method, is because you are trying to download from an https website.

My guess is you are trying to install all the gems in your gemfile and bundle install didn't work. It would give you a message like

bundler cannot continue. Please make sure gem install samplegem succeeds

Change the following line in your gemfile

source 'https://rubygems.org'

to

source 'http://rubygems.org'

and run bundle

alternatively, you could do the following

gem install mysql2 -s http://rubygems.org

Either way, you should be able to install the gem.

like image 122
Darkmouse Avatar answered Oct 29 '22 11:10

Darkmouse


Had you already installed mysql in your machine? The same experiencing happened with me. I was using a virtual environment and trying to install gem mysql2 but I forget that I haven't mysql in my "main" environment.

like image 29
Italo Lemos Avatar answered Oct 29 '22 12:10

Italo Lemos