Results 1 to 6 of 6

Thread: how to install 'mysql2' gem ?

  1. #1

    Default how to install 'mysql2' gem ?

    i have opensuse 13.1 ... getting error while installing mysql2 gem

    output:

    Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /home/akash/.rvm/rubies/ruby-2.0.0-p451/bin/ruby extconf.rb
    checking for ruby/thread.h... yes
    checking for rb_thread_call_without_gvl() in ruby/thread.h... yes
    checking for rb_thread_blocking_region()... yes
    checking for rb_wait_for_single_fd()... yes
    checking for rb_hash_dup()... yes
    checking for rb_intern3()... yes
    -----
    Using mysql_config at /usr/bin/mysql_config
    -----
    checking for mysql.h... yes
    checking for errmsg.h... yes
    checking for mysqld_error.h... yes
    -----
    Setting libpath to /usr/lib64
    -----
    creating Makefile

    make "DESTDIR=" clean

    make "DESTDIR="
    compiling infile.c
    compiling client.c
    compiling result.c
    compiling mysql2_ext.c
    linking shared-object mysql2/mysql2.so
    /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: cannot find -lmysqlclient
    collect2: error: ld returned 1 exit status
    make: *** [mysql2.so] Error 1

    make failed, exit code 2

    Gem files will remain installed in /home/akash/.rvm/gems/ruby-2.0.0-p451/gems/mysql2-0.3.15 for inspection.
    Results logged to /home/akash/.rvm/gems/ruby-2.0.0-p451/extensions/x86_64-linux/2.0.0/mysql2-0.3.15/gem_make.out
    An error occurred while installing mysql2 (0.3.15), and Bundler cannot continue.
    Make sure that `gem install mysql2 -v '0.3.15'` succeeds before bundling.


    solution on other linux is

    sudo apt-get install mysql-client libmysqlclient-dev
    but don't know how to install these packages on opensuse 13.1

  2. #2
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    24,973

    Default Re: how to install 'mysql2' gem ?

    I have no real knowledge about the particular action you are trying to do, but I understand that you do not even know how to manage software on openSUSE.

    You use either the GUI: YaST > Software > Software Management, or the CLI with zypper
    Code:
    man zypper
    BTW, next time you try to post computer text, please copy/paste it from the terminal in between CODE tags in the post. You get the CODE tags by clicking on the # button in the tool bar ofthe post editor.
    Last edited by hcvv; 24-Apr-2014 at 05:35.
    Henk van Velden

  3. #3

    Default AW: how to install 'mysql2' gem ?

    Quote Originally Posted by akashkumarEngg View Post
    solution on other linux is



    but don't know how to install these packages on opensuse 13.1
    Code:
    sudo zypper in libmysqlclient-devel
    Or use YaST->Software Management.
    Last edited by wolfi323; 24-Apr-2014 at 05:41.

  4. #4

    Default Re: how to install 'mysql2' gem ?

    still getting error !
    Code:
    Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
    
        /home/akash/.rvm/rubies/ruby-2.0.0-p451/bin/ruby extconf.rb 
    checking for ruby/thread.h... yes
    checking for rb_thread_call_without_gvl() in ruby/thread.h... yes
    checking for rb_thread_blocking_region()... yes
    checking for rb_wait_for_single_fd()... yes
    checking for rb_hash_dup()... yes
    checking for rb_intern3()... yes
    -----
    Using mysql_config at /usr/bin/mysql_config
    -----
    checking for mysql.h... yes
    checking for errmsg.h... yes
    checking for mysqld_error.h... yes
    -----
    Setting libpath to /usr/lib64
    -----
    creating Makefile
    
    make "DESTDIR=" clean
    
    make "DESTDIR="
    compiling infile.c
    compiling client.c
    compiling result.c
    compiling mysql2_ext.c
    linking shared-object mysql2/mysql2.so
    /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: cannot find -lmysqlclient
    collect2: error: ld returned 1 exit status
    make: *** [mysql2.so] Error 1
    
    make failed, exit code 2
    
    Gem files will remain installed in /home/akash/.rvm/gems/ruby-2.0.0-p451/gems/mysql2-0.3.15 for inspection.
    Results logged to /home/akash/.rvm/gems/ruby-2.0.0-p451/extensions/x86_64-linux/2.0.0/mysql2-0.3.15/gem_make.out
    An error occurred while installing mysql2 (0.3.15), and Bundler cannot continue.
    Make sure that `gem install mysql2 -v '0.3.15'` succeeds before bundling.
    I’m using MySQL server


  5. #5

  6. #6
    Join Date
    Oct 2008
    Location
    Glasgow, Scotland
    Posts
    1,131

    Default Re: how to install 'mysql2' gem ?

    Quote Originally Posted by akashkumarEngg View Post
    still getting error !
    Code:
    Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
    ...
    failed while installing mysql2 (0.3.15), and Bundler cannot continue.
    Make sure that `gem install mysql2 -v '0.3.15'` succeeds before bundling.
    I’m using MySQL server

    You haven't explained exactly what it is that you are trying to achieve.
    If you copied the commands you used into the CODE block, instead of just some output, we could see what you were doing.
    You should not expect others to be able to access random file-sharing sites. This forum has its own http://paste.opensuse.org/.

    I am guessing that you want to use Ruby Gems, and for some reason you are trying to compile a package designed for another distribution. OpenSUSE/SUSE has an excellent package manager, and a very large software library/repositories. That has always been on of its main "selling points".

    Ruby mysql2 is different from MariaDB/MySQL.

    Open YaST > Software Management (either from the GUI or in a terminal). Search for "rubygem". You will discover a selection of "gems", incuding "rubygem-mysql2", together with documentation, and a test suite. Select the packages you want, and "Accept".
    ~Thank you for sharing an interesting problem.
    --
    slàinte mhath,
    rayH

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •