Failed to install “Mysql2” version 0.5.2












2















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?










share|improve this question




















  • 1





    When you run gem install mysql2 -v '0.5.2' --source 'https://rubygems.org/', what is the output?

    – Sara Tibbetts
    Nov 21 '18 at 15:53











  • I tried to install older versions of Mysql2 0.5.1, 0.5.0, too. But it is failed...

    – Daisuke
    Nov 21 '18 at 15:54











  • Hi, Sara ERROR: While executing gem ... (Errno::EACCES) Permission denied @ rb_sysopen - /Users/daisuke/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/mysql2-0.5.2/CHANGELOG.md

    – Daisuke
    Nov 21 '18 at 15:56













  • I did sudo, too. sudo gem install mysql2 -v '0.5.2' --source 'rubygems.org' Password: Building native extensions. This could take a while... ERROR: Error installing mysql2: ERROR: Failed to build gem native extension.

    – Daisuke
    Nov 21 '18 at 15:58













  • Hi, hernanvicente. macOS Mojave 10.14.1

    – Daisuke
    Nov 21 '18 at 16:09


















2















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?










share|improve this question




















  • 1





    When you run gem install mysql2 -v '0.5.2' --source 'https://rubygems.org/', what is the output?

    – Sara Tibbetts
    Nov 21 '18 at 15:53











  • I tried to install older versions of Mysql2 0.5.1, 0.5.0, too. But it is failed...

    – Daisuke
    Nov 21 '18 at 15:54











  • Hi, Sara ERROR: While executing gem ... (Errno::EACCES) Permission denied @ rb_sysopen - /Users/daisuke/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/mysql2-0.5.2/CHANGELOG.md

    – Daisuke
    Nov 21 '18 at 15:56













  • I did sudo, too. sudo gem install mysql2 -v '0.5.2' --source 'rubygems.org' Password: Building native extensions. This could take a while... ERROR: Error installing mysql2: ERROR: Failed to build gem native extension.

    – Daisuke
    Nov 21 '18 at 15:58













  • Hi, hernanvicente. macOS Mojave 10.14.1

    – Daisuke
    Nov 21 '18 at 16:09
















2












2








2


1






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?










share|improve this question
















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?







ruby-on-rails ruby






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 21 '18 at 16:33









hernanvicente

664615




664615










asked Nov 21 '18 at 15:52









DaisukeDaisuke

112




112








  • 1





    When you run gem install mysql2 -v '0.5.2' --source 'https://rubygems.org/', what is the output?

    – Sara Tibbetts
    Nov 21 '18 at 15:53











  • I tried to install older versions of Mysql2 0.5.1, 0.5.0, too. But it is failed...

    – Daisuke
    Nov 21 '18 at 15:54











  • Hi, Sara ERROR: While executing gem ... (Errno::EACCES) Permission denied @ rb_sysopen - /Users/daisuke/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/mysql2-0.5.2/CHANGELOG.md

    – Daisuke
    Nov 21 '18 at 15:56













  • I did sudo, too. sudo gem install mysql2 -v '0.5.2' --source 'rubygems.org' Password: Building native extensions. This could take a while... ERROR: Error installing mysql2: ERROR: Failed to build gem native extension.

    – Daisuke
    Nov 21 '18 at 15:58













  • Hi, hernanvicente. macOS Mojave 10.14.1

    – Daisuke
    Nov 21 '18 at 16:09
















  • 1





    When you run gem install mysql2 -v '0.5.2' --source 'https://rubygems.org/', what is the output?

    – Sara Tibbetts
    Nov 21 '18 at 15:53











  • I tried to install older versions of Mysql2 0.5.1, 0.5.0, too. But it is failed...

    – Daisuke
    Nov 21 '18 at 15:54











  • Hi, Sara ERROR: While executing gem ... (Errno::EACCES) Permission denied @ rb_sysopen - /Users/daisuke/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/mysql2-0.5.2/CHANGELOG.md

    – Daisuke
    Nov 21 '18 at 15:56













  • I did sudo, too. sudo gem install mysql2 -v '0.5.2' --source 'rubygems.org' Password: Building native extensions. This could take a while... ERROR: Error installing mysql2: ERROR: Failed to build gem native extension.

    – Daisuke
    Nov 21 '18 at 15:58













  • Hi, hernanvicente. macOS Mojave 10.14.1

    – Daisuke
    Nov 21 '18 at 16:09










1




1





When you run gem install mysql2 -v '0.5.2' --source 'https://rubygems.org/', what is the output?

– Sara Tibbetts
Nov 21 '18 at 15:53





When you run gem install mysql2 -v '0.5.2' --source 'https://rubygems.org/', what is the output?

– Sara Tibbetts
Nov 21 '18 at 15:53













I tried to install older versions of Mysql2 0.5.1, 0.5.0, too. But it is failed...

– Daisuke
Nov 21 '18 at 15:54





I tried to install older versions of Mysql2 0.5.1, 0.5.0, too. But it is failed...

– Daisuke
Nov 21 '18 at 15:54













Hi, Sara ERROR: While executing gem ... (Errno::EACCES) Permission denied @ rb_sysopen - /Users/daisuke/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/mysql2-0.5.2/CHANGELOG.md

– Daisuke
Nov 21 '18 at 15:56







Hi, Sara ERROR: While executing gem ... (Errno::EACCES) Permission denied @ rb_sysopen - /Users/daisuke/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/mysql2-0.5.2/CHANGELOG.md

– Daisuke
Nov 21 '18 at 15:56















I did sudo, too. sudo gem install mysql2 -v '0.5.2' --source 'rubygems.org' Password: Building native extensions. This could take a while... ERROR: Error installing mysql2: ERROR: Failed to build gem native extension.

– Daisuke
Nov 21 '18 at 15:58







I did sudo, too. sudo gem install mysql2 -v '0.5.2' --source 'rubygems.org' Password: Building native extensions. This could take a while... ERROR: Error installing mysql2: ERROR: Failed to build gem native extension.

– Daisuke
Nov 21 '18 at 15:58















Hi, hernanvicente. macOS Mojave 10.14.1

– Daisuke
Nov 21 '18 at 16:09







Hi, hernanvicente. macOS Mojave 10.14.1

– Daisuke
Nov 21 '18 at 16:09














1 Answer
1






active

oldest

votes


















0














This is a very good post. I was facing the same issue using mac. What I ended up doing was the following.




  1. I changed the permission for the Gemfile. I used chmod 755 Gemfile.


  2. I used sudo bundle install. This allowed me to install all the gems in the Gemfile.


  3. I did a rake db:create and rails server.



Got things working. Hope it fixes your issue too.






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%2f53415815%2ffailed-to-install-mysql2-version-0-5-2%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    This is a very good post. I was facing the same issue using mac. What I ended up doing was the following.




    1. I changed the permission for the Gemfile. I used chmod 755 Gemfile.


    2. I used sudo bundle install. This allowed me to install all the gems in the Gemfile.


    3. I did a rake db:create and rails server.



    Got things working. Hope it fixes your issue too.






    share|improve this answer




























      0














      This is a very good post. I was facing the same issue using mac. What I ended up doing was the following.




      1. I changed the permission for the Gemfile. I used chmod 755 Gemfile.


      2. I used sudo bundle install. This allowed me to install all the gems in the Gemfile.


      3. I did a rake db:create and rails server.



      Got things working. Hope it fixes your issue too.






      share|improve this answer


























        0












        0








        0







        This is a very good post. I was facing the same issue using mac. What I ended up doing was the following.




        1. I changed the permission for the Gemfile. I used chmod 755 Gemfile.


        2. I used sudo bundle install. This allowed me to install all the gems in the Gemfile.


        3. I did a rake db:create and rails server.



        Got things working. Hope it fixes your issue too.






        share|improve this answer













        This is a very good post. I was facing the same issue using mac. What I ended up doing was the following.




        1. I changed the permission for the Gemfile. I used chmod 755 Gemfile.


        2. I used sudo bundle install. This allowed me to install all the gems in the Gemfile.


        3. I did a rake db:create and rails server.



        Got things working. Hope it fixes your issue too.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Dec 27 '18 at 14:05









        A1aksA1aks

        102213




        102213






























            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%2f53415815%2ffailed-to-install-mysql2-version-0-5-2%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

            "Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

            Alcedinidae

            RAC Tourist Trophy