Project

General

Profile

Can't complete installation (problems with ruby, mysql2 , or something nearby)

Added by Balaco Baco about 9 years ago

Steps I did today, following RedmineInstall:

  1. svn checkout stable -> v3.0 (step 1)
  2. database and user already exist, so I skipped step 2
  3. step 3 is a bit unclear on its description, so I just tried mysql2 and mysql in the adapter config, at different moments
  4. step 4 took time to figure out! Please improve it. And after many tries, now it fails with this output, which I'm looking for help in this forum:
    $ bundle install --without development test rmagick --path [HOME/].ruby-gems/bundle/
    Fetching gem metadata from https://rubygems.org/.........
    Fetching version metadata from https://rubygems.org/..
    Resolving dependencies...
    Using rake 10.4.2
    Using i18n 0.7.0
    Using json 1.8.2
    Using minitest 5.6.1
    Using thread_safe 0.3.5
    Using tzinfo 1.2.2
    Using activesupport 4.2.1
    Using builder 3.2.2
    Using erubis 2.7.0
    Using mini_portile 0.6.2
    Using nokogiri 1.6.6.2
    Using rails-deprecated_sanitizer 1.0.3
    Using rails-dom-testing 1.0.6
    Using loofah 2.0.1
    Using rails-html-sanitizer 1.0.2
    Using actionview 4.2.1
    Using rack 1.6.0
    Using rack-test 0.6.3
    Using actionpack 4.2.1
    Using globalid 0.3.5
    Using activejob 4.2.1
    Using mime-types 2.5
    Using mail 2.6.3
    Using actionmailer 4.2.1
    Using actionpack-action_caching 1.1.1
    Using actionpack-xml_parser 1.0.2
    Using activemodel 4.2.1
    Using arel 6.0.0
    Using activerecord 4.2.1
    Using bundler 1.9.5
    Using coderay 1.1.0
    Using thor 0.19.1
    Using railties 4.2.1
    Using jquery-rails 3.1.2
    
    Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
    
            /usr/bin/ruby1.9.1 extconf.rb
    checking for ruby/thread.h... no
    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
    checking for mysql_query() in -lmysqlclient... no
    checking for main() in -lm... yes
    checking for mysql_query() in -lmysqlclient... no
    checking for main() in -lz... yes
    checking for mysql_query() in -lmysqlclient... no
    checking for main() in -lsocket... no
    checking for mysql_query() in -lmysqlclient... no
    checking for main() in -lnsl... yes
    checking for mysql_query() in -lmysqlclient... no
    checking for main() in -lmygcc... no
    checking for mysql_query() in -lmysqlclient... no
    *** extconf.rb failed ***
    Could not create Makefile due to some reason, probably lack of
    necessary libraries and/or headers.  Check the mkmf.log file for more
    details.  You may need configuration options.
    
    Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/usr/bin/ruby1.9.1
        --with-mysql-dir
        --without-mysql-dir
        --with-mysql-include
        --without-mysql-include=${mysql-dir}/include
        --with-mysql-lib
        --without-mysql-lib=${mysql-dir}/lib
        --with-mysql-config
        --without-mysql-config
        --with-mysql-dir
        --without-mysql-dir
        --with-mysql-include
        --without-mysql-include=${mysql-dir}/include
        --with-mysql-lib
        --without-mysql-lib=${mysql-dir}/lib
        --with-mysqlclientlib
        --without-mysqlclientlib
        --with-mlib
        --without-mlib
        --with-mysqlclientlib
        --without-mysqlclientlib
        --with-zlib
        --without-zlib
        --with-mysqlclientlib
        --without-mysqlclientlib
        --with-socketlib
        --without-socketlib
        --with-mysqlclientlib
        --without-mysqlclientlib
        --with-nsllib
        --without-nsllib
        --with-mysqlclientlib
        --without-mysqlclientlib
        --with-mygcclib
        --without-mygcclib
        --with-mysqlclientlib
        --without-mysqlclientlib
    
    Gem files will remain installed in [HOME/].ruby-gems/bundle/ruby/1.9.1/gems/mysql2-0.3.18 for inspection.
    Results logged to [HOME/].ruby-gems/bundle/ruby/1.9.1/gems/mysql2-0.3.18/ext/mysql2/gem_make.out
    An error occurred while installing mysql2 (0.3.18), and Bundler cannot continue.
    Make sure that `gem install mysql2 -v '0.3.18'` succeeds before bundling.
    
    $ 
    
  5. The command suggestion in the error ending outputs (and I also needed to discover/remember about the --user-install need in my instalation; both documentation and warning could note this possible issue):
    $ gem install mysql2 -v '0.3.18' --user-install
    This could take a while...
    ERROR:  Error installing mysql2:
        ERROR: Failed to build gem native extension.
    
            /usr/bin/ruby1.9.1 extconf.rb
    checking for ruby/thread.h... no
    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
    checking for mysql_query() in -lmysqlclient... no
    checking for main() in -lm... yes
    checking for mysql_query() in -lmysqlclient... no
    checking for main() in -lz... yes
    checking for mysql_query() in -lmysqlclient... no
    checking for main() in -lsocket... no
    checking for mysql_query() in -lmysqlclient... no
    checking for main() in -lnsl... yes
    checking for mysql_query() in -lmysqlclient... no
    checking for main() in -lmygcc... no
    checking for mysql_query() in -lmysqlclient... no
    *** extconf.rb failed ***
    Could not create Makefile due to some reason, probably lack of
    necessary libraries and/or headers.  Check the mkmf.log file for more
    details.  You may need configuration options.
    
    Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/usr/bin/ruby1.9.1
        --with-mysql-dir
        --without-mysql-dir
        --with-mysql-include
        --without-mysql-include=${mysql-dir}/include
        --with-mysql-lib
        --without-mysql-lib=${mysql-dir}/lib
        --with-mysql-config
        --without-mysql-config
        --with-mysql-dir
        --without-mysql-dir
        --with-mysql-include
        --without-mysql-include=${mysql-dir}/include
        --with-mysql-lib
        --without-mysql-lib=${mysql-dir}/lib
        --with-mysqlclientlib
        --without-mysqlclientlib
        --with-mlib
        --without-mlib
        --with-mysqlclientlib
        --without-mysqlclientlib
        --with-zlib
        --without-zlib
        --with-mysqlclientlib
        --without-mysqlclientlib
        --with-socketlib
        --without-socketlib
        --with-mysqlclientlib
        --without-mysqlclientlib
        --with-nsllib
        --without-nsllib
        --with-mysqlclientlib
        --without-mysqlclientlib
        --with-mygcclib
        --without-mygcclib
        --with-mysqlclientlib
        --without-mysqlclientlib
    
    Gem files will remain installed in /home/grad/ccomp/11/avic/.gem/ruby/1.9.1/gems/mysql2-0.3.18 for inspection.
    Results logged to /home/grad/ccomp/11/avic/.gem/ruby/1.9.1/gems/mysql2-0.3.18/ext/mysql2/gem_make.out
    
    
  6. I can't locate the file "mkmf.log" mentioned above. Where it should be? It's not on redmine's log folder.

Replies (2)

RE: Can't complete installation (problems with ruby, mysql2 , or something nearby) - Added by Leonel Iturralde about 9 years ago

Hi,
it seems that you don't have the libraries necessary to compile mysql2.

Try using google or any other search engine to see which libraries you need.

RE: Can't complete installation (problems with ruby, mysql2 , or something nearby) - Added by Martin Denizet (redmine.org team member) about 9 years ago

Hello,

You mentioned already having a database, I suggest you to also have a look to the RedmineUpgrade wiki.
Doing an upgrade, you should not forget the following command:

bundle exec rake db:migrate RAILS_ENV=production

Regarding the MySQL native extension, as Leonel mentioned you need additional libraries.
For Ubuntu:

sudo apt-get install mysql-server libmysqlclient-dev

For Debian:
apt-get install mysql-server libmysqlclient-dev

I hope it helps,

Cheers

    (1-2/2)