Could not find gem 'mysql2 (= 0.3.18)' in any of the gem sources listed in your Gemfile












1















I got below error while creating new rails application. I ran bundle install but didn't work it.



Could not find gem 'mysql2 (< 0.5, >= 0.3.18)' in any of the gem sources listed in your Gemfile.



Gemfile



git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git"
end


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.1.5'
# Use mysql as the database for Active Record
gem 'mysql2', '>= 0.3.18', '< 0.5'
# Use Puma as the app server
gem 'puma', '~> 3.7'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby









share|improve this question























  • check rubygems.org/gems/mysql2 and update version in Gemfile

    – Haseeb Eqx
    Mar 4 '18 at 9:37
















1















I got below error while creating new rails application. I ran bundle install but didn't work it.



Could not find gem 'mysql2 (< 0.5, >= 0.3.18)' in any of the gem sources listed in your Gemfile.



Gemfile



git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git"
end


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.1.5'
# Use mysql as the database for Active Record
gem 'mysql2', '>= 0.3.18', '< 0.5'
# Use Puma as the app server
gem 'puma', '~> 3.7'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby









share|improve this question























  • check rubygems.org/gems/mysql2 and update version in Gemfile

    – Haseeb Eqx
    Mar 4 '18 at 9:37














1












1








1








I got below error while creating new rails application. I ran bundle install but didn't work it.



Could not find gem 'mysql2 (< 0.5, >= 0.3.18)' in any of the gem sources listed in your Gemfile.



Gemfile



git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git"
end


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.1.5'
# Use mysql as the database for Active Record
gem 'mysql2', '>= 0.3.18', '< 0.5'
# Use Puma as the app server
gem 'puma', '~> 3.7'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby









share|improve this question














I got below error while creating new rails application. I ran bundle install but didn't work it.



Could not find gem 'mysql2 (< 0.5, >= 0.3.18)' in any of the gem sources listed in your Gemfile.



Gemfile



git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git"
end


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.1.5'
# Use mysql as the database for Active Record
gem 'mysql2', '>= 0.3.18', '< 0.5'
# Use Puma as the app server
gem 'puma', '~> 3.7'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby






ruby-on-rails ruby






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 4 '18 at 9:21









kiran kumarkiran kumar

112




112













  • check rubygems.org/gems/mysql2 and update version in Gemfile

    – Haseeb Eqx
    Mar 4 '18 at 9:37



















  • check rubygems.org/gems/mysql2 and update version in Gemfile

    – Haseeb Eqx
    Mar 4 '18 at 9:37

















check rubygems.org/gems/mysql2 and update version in Gemfile

– Haseeb Eqx
Mar 4 '18 at 9:37





check rubygems.org/gems/mysql2 and update version in Gemfile

– Haseeb Eqx
Mar 4 '18 at 9:37












2 Answers
2






active

oldest

votes


















0














When I tried with what you have provided, I was able to install mysql2 gem. Give it a go with this one (change or install the ruby version first) and let me know if it didn't change anything:



source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '2.5.0'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.2.0.rc1'
# Use Puma as the app server
gem 'puma', '~> 3.11'
# Use mysql as the database for Active Record
gem 'mysql2', '>= 0.3.18', '< 0.5'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'mini_racer', platforms: :ruby





share|improve this answer































    0














    Try to delete your Gemfile.lock and run bundle install again



    rm Gemfile.lock
    bundle install





    share|improve this answer























      Your Answer






      StackExchange.ifUsing("editor", function () {
      StackExchange.using("externalEditor", function () {
      StackExchange.using("snippets", function () {
      StackExchange.snippets.init();
      });
      });
      }, "code-snippets");

      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "1"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f49093862%2fcould-not-find-gem-mysql2-0-5-0-3-18-in-any-of-the-gem-sources-listed%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      0














      When I tried with what you have provided, I was able to install mysql2 gem. Give it a go with this one (change or install the ruby version first) and let me know if it didn't change anything:



      source 'https://rubygems.org'
      git_source(:github) { |repo| "https://github.com/#{repo}.git" }

      ruby '2.5.0'

      # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
      gem 'rails', '~> 5.2.0.rc1'
      # Use Puma as the app server
      gem 'puma', '~> 3.11'
      # Use mysql as the database for Active Record
      gem 'mysql2', '>= 0.3.18', '< 0.5'
      # Use SCSS for stylesheets
      gem 'sass-rails', '~> 5.0'
      # Use Uglifier as compressor for JavaScript assets
      gem 'uglifier', '>= 1.3.0'
      # See https://github.com/rails/execjs#readme for more supported runtimes
      # gem 'mini_racer', platforms: :ruby





      share|improve this answer




























        0














        When I tried with what you have provided, I was able to install mysql2 gem. Give it a go with this one (change or install the ruby version first) and let me know if it didn't change anything:



        source 'https://rubygems.org'
        git_source(:github) { |repo| "https://github.com/#{repo}.git" }

        ruby '2.5.0'

        # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
        gem 'rails', '~> 5.2.0.rc1'
        # Use Puma as the app server
        gem 'puma', '~> 3.11'
        # Use mysql as the database for Active Record
        gem 'mysql2', '>= 0.3.18', '< 0.5'
        # Use SCSS for stylesheets
        gem 'sass-rails', '~> 5.0'
        # Use Uglifier as compressor for JavaScript assets
        gem 'uglifier', '>= 1.3.0'
        # See https://github.com/rails/execjs#readme for more supported runtimes
        # gem 'mini_racer', platforms: :ruby





        share|improve this answer


























          0












          0








          0







          When I tried with what you have provided, I was able to install mysql2 gem. Give it a go with this one (change or install the ruby version first) and let me know if it didn't change anything:



          source 'https://rubygems.org'
          git_source(:github) { |repo| "https://github.com/#{repo}.git" }

          ruby '2.5.0'

          # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
          gem 'rails', '~> 5.2.0.rc1'
          # Use Puma as the app server
          gem 'puma', '~> 3.11'
          # Use mysql as the database for Active Record
          gem 'mysql2', '>= 0.3.18', '< 0.5'
          # Use SCSS for stylesheets
          gem 'sass-rails', '~> 5.0'
          # Use Uglifier as compressor for JavaScript assets
          gem 'uglifier', '>= 1.3.0'
          # See https://github.com/rails/execjs#readme for more supported runtimes
          # gem 'mini_racer', platforms: :ruby





          share|improve this answer













          When I tried with what you have provided, I was able to install mysql2 gem. Give it a go with this one (change or install the ruby version first) and let me know if it didn't change anything:



          source 'https://rubygems.org'
          git_source(:github) { |repo| "https://github.com/#{repo}.git" }

          ruby '2.5.0'

          # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
          gem 'rails', '~> 5.2.0.rc1'
          # Use Puma as the app server
          gem 'puma', '~> 3.11'
          # Use mysql as the database for Active Record
          gem 'mysql2', '>= 0.3.18', '< 0.5'
          # Use SCSS for stylesheets
          gem 'sass-rails', '~> 5.0'
          # Use Uglifier as compressor for JavaScript assets
          gem 'uglifier', '>= 1.3.0'
          # See https://github.com/rails/execjs#readme for more supported runtimes
          # gem 'mini_racer', platforms: :ruby






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 6 '18 at 7:58









          ogirgincogirginc

          9351419




          9351419

























              0














              Try to delete your Gemfile.lock and run bundle install again



              rm Gemfile.lock
              bundle install





              share|improve this answer




























                0














                Try to delete your Gemfile.lock and run bundle install again



                rm Gemfile.lock
                bundle install





                share|improve this answer


























                  0












                  0








                  0







                  Try to delete your Gemfile.lock and run bundle install again



                  rm Gemfile.lock
                  bundle install





                  share|improve this answer













                  Try to delete your Gemfile.lock and run bundle install again



                  rm Gemfile.lock
                  bundle install






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jan 20 at 13:56









                  Kohn1001Kohn1001

                  528412




                  528412






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f49093862%2fcould-not-find-gem-mysql2-0-5-0-3-18-in-any-of-the-gem-sources-listed%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Callistus III

                      Ostreoida

                      Plistias Cous