bngsudheer/ansible-role-redmine

Could not find gem 'mysql2 (~> 0.3.11)

ivn86 opened this issue · 13 comments

ivn86 commented

There are some missing requirements.
TASK [bngsudheer.redmine : Generate secret token] ****************************** fatal: [192.168.100.71]: FAILED! => {"changed": true, "cmd": "/home/redmine/bin/bundle exec /home/redmine/bin/rake generate_secret_token", "delta": "0:00:00.460115", "end": "2017-07-26 15:00:39.286941", "failed": true, "rc": 1, "start": "2017-07-26 15:00:38.826826", "stderr": "Bundler::GemNotFound: Could not find gem 'mysql2 (~> 0.3.11)' in any of the gem sources listed in your Gemfile.\n /home/redmine/.gem/ruby/gems/bundler-1.15.3/lib/bundler/resolver.rb:396:in block in verify_gemfile_dependencies_are_found!'\n /home/redmine/.gem/ruby/gems/bundler-1.15.3/lib/bundler/resolver.rb:366:in each'\n /home/redmine/.gem/ruby/gems/bundler-1.15.3/lib/bundler/resolver.rb:366:in verify_gemfile_dependencies_are_found!'\n /home/redmine/.gem/ruby/gems/bundler-1.15.3/lib/bundler/resolver.rb:212:in start'\n /home/redmine/.gem/ruby/gems/bundler-1.15.3/lib/bundler/resolver.rb:191:in resolve'\n /home/redmine/.gem/ruby/gems/bundler-1.15.3/lib/bundler/definition.rb:235:in resolve'\n /home/redmine/.gem/ruby/gems/bundler-1.15.3/lib/bundler/definition.rb:159:in specs'\n /home/redmine/.gem/ruby/gems/bundler-1.15.3/lib/bundler/definition.rb:218:in specs_for'\n /home/redmine/.gem/ruby/gems/bundler-1.15.3/lib/bundler/definition.rb:207:in requested_specs'\n /home/redmine/.gem/ruby/gems/bundler-1.15.3/lib/bundler/runtime.rb:109:in block in definition_method'\n /home/redmine/.gem/ruby/gems/bundler-1.15.3/lib/bundler/runtime.rb:21:in setup'\n /home/redmine/.gem/ruby/gems/bundler-1.15.3/lib/bundler.rb:101:in setup'\n /home/redmine/.gem/ruby/gems/bundler-1.15.3/lib/bundler/setup.rb:19:in <top (required)>'\n /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in require'\n /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in require'", "stdout": "bundler: failed to load command: /home/redmine/bin/rake (/home/redmine/bin/rake)", "stdout_lines": ["bundler: failed to load command: /home/redmine/bin/rake (/home/redmine/bin/rake)"], "warnings": []}
`

I have pushed a fix for this. Please try after pulling.

ivn86 commented

Now there is error in "Install the required gems via bundler":

Fetching rmagick 2.16.0
Installing rmagick 2.16.0 with native extensions
...
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
...
Results logged to /home/redmine/.gem/ruby/gems/rmagick-2.16.0/ext/RMagick/gem_make.out
An error occurred while installing rmagick (2.16.0), and Bundler cannot continue.
Make sure that gem install rmagick -v '2.16.0' succeeds before bundling.

And this is /home/redmine/.gem/ruby/gems/rmagick-2.16.0/ext/RMagick/gem_make.out content:

/usr/bin/ruby extconf.rb
checking for gcc... yes
checking for Magick-config... yes
*** 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}/lib64
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/ruby
extconf.rb:189:in ``': No such file or directory - which (Errno::ENOENT)
from extconf.rb:189:in has_graphicsmagick_libmagick_dev_compat?' from extconf.rb:66:in configure_compile_options'
from extconf.rb:16:in `initialize'
from extconf.rb:548:in `new'
from extconf.rb:548:in `<main>'

Could you upload mkmf.log?

ivn86 commented

There is a losing dependency (libffi-devel). I have added it to dependency list and now got a new error.

/home/redmine/bin/bundler install
The latest bundler is 1.16.0, but you are currently running 1.15.4.
To update, run gem install bundler
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x64-mingw32, x86-mswin32. To add those platforms to the bundle, run bundle lock --add-platform x86-mingw32 x64-mingw32 x86-mswin32.
/usr/share/gems/gems/psych-2.0.0/lib/psych.rb:98: warning: already initialized constant Psych::VERSION
/usr/share/ruby/psych.rb:98: warning: previous definition of VERSION was here
/usr/share/gems/gems/psych-2.0.0/lib/psych.rb:101: warning: already initialized constant Psych::LIBYAML_VERSION
/usr/share/ruby/psych.rb:101: warning: previous definition of LIBYAML_VERSION was here
Fetching gem metadata from https://rubygems.org/..........
Fetching version metadata from https://rubygems.org/..
Fetching dependency metadata from https://rubygems.org/.
Resolving dependencies...
Rubygems 2.0.14.1 is not threadsafe, so your gems will be installed one at a time. Upgrade to Rubygems 2.1.0 or higher to enable parallel gem installation.
Using rake 12.3.0
Using i18n 0.7.0
Using minitest 5.10.3
Using thread_safe 0.3.6
Using builder 3.2.3
Using erubis 2.7.0
Using mini_portile2 2.1.0
Using crass 1.0.3
Using rack 1.6.8
Using mini_mime 1.0.0
Using arel 6.0.4
Using public_suffix 2.0.5
Using bundler 1.15.4
Using ffi 1.9.18
Using coderay 1.1.2
Using concurrent-ruby 1.0.5
Using docile 1.1.5
Using htmlentities 4.3.4
Using thor 0.20.0
Using metaclass 0.0.4
Using mime-types-data 3.2016.0521
Using mimemagic 0.3.2
Using multi_json 1.12.2
Using mysql2 0.4.10
Using net-ldap 0.12.1
Using ruby-openid 2.3.0
Using rbpdf-font 1.19.1
Using rdoc 4.3.0
Using redcarpet 3.4.0
Using request_store 1.0.5
Fetching rmagick 2.16.0
Installing rmagick 2.16.0 with native extensions
Using rubyzip 1.2.1
Using websocket 1.2.5
Using simplecov-html 0.9.0
Using yard 0.9.9
Using tzinfo 1.2.4
Using nokogiri 1.6.8.1
Using rack-test 0.6.3
Using mail 2.7.0
Using addressable 2.5.2
Using childprocess 0.8.0
Using sprockets 3.7.1
Using mocha 1.3.0
Using mime-types 3.1
Using rack-openid 1.4.2
Using rbpdf 1.19.3
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

/usr/bin/ruby extconf.rb

checking for gcc... yes
checking for Magick-config... yes
*** 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}/lib64
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/ruby
extconf.rb:189:in ``': No such file or directory - which (Errno::ENOENT)
from extconf.rb:189:in has_graphicsmagick_libmagick_dev_compat?' from extconf.rb:66:in configure_compile_options'
from extconf.rb:16:in `initialize'
from extconf.rb:548:in `new'
from extconf.rb:548:in `<main>'

Gem files will remain installed in /home/redmine/.gem/ruby/gems/rmagick-2.16.0 for inspection.
Results logged to /home/redmine/.gem/ruby/gems/rmagick-2.16.0/ext/RMagick/gem_make.out

An error occurred while installing rmagick (2.16.0), and Bundler cannot continue.
Make sure that gem install rmagick -v '2.16.0' succeeds before bundling.

In Gemfile:
rmagick

Content of /home/redmine/.gem/ruby/gems/rmagick-2.16.0/ext/RMagick/gem_make.out:

/usr/bin/ruby extconf.rb
checking for gcc... yes
checking for Magick-config... yes
*** 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}/lib64
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/ruby
extconf.rb:189:in ``': No such file or directory - which (Errno::ENOENT)
from extconf.rb:189:in has_graphicsmagick_libmagick_dev_compat?' from extconf.rb:66:in configure_compile_options'
from extconf.rb:16:in `initialize'
from extconf.rb:548:in `new'
from extconf.rb:548:in `<main>'

All mkmf.log-s in attachment.
mkmf_ffi.log
mkmf_mysql2.log
mkmf_nokogiri.log
mkmf_rmagic.log

mkmf_rmagic.log doesn't have much information.
What version of CentOS are you using?
Output of
cat /etc/centos-release
will be useful.

I am unable to reproduce this issue. Could you try removing /home/redmine/.gems and /home/redmine/.bundle directories?

Could you try once again using the role bngsudheer.centos_base? I was not able to reproduce this. But I think this maybe related to a container image of CentOS. Did you try the role on a container?

ivn86 commented

Still not works. On fresh and updated centos 7 with enabled epel-release and role bngsudheer.centos_base i got a new errors:

TASK [bngsudheer.redmine : Install the required gems via bundler] *************************************************************************************************************************************************
fatal: [192.168.100.155]: FAILED! => {"changed": false, "cmd": "/home/redmine/bin/bundler install --gemfile /home/redmine/redmine/Gemfile", "msg": "/usr/share/gems/gems/psych-2.0.0/lib/psych.rb:98: warning: already initialized constant Psych::VERSION\n/usr/share/ruby/psych.rb:98: warning: previous definition of VERSION was here\n/usr/share/gems/gems/psych-2.0.0/lib/psych.rb:101: warning: already initialized constant Psych::LIBYAML_VERSION\n/usr/share/ruby/psych.rb:101: warning: previous definition of LIBYAML_VERSION was here", "rc": 5, "stderr": "/usr/share/gems/gems/psych-2.0.0/lib/psych.rb:98: warning: already initialized constant Psych::VERSION\n/usr/share/ruby/psych.rb:98: warning: previous definition of VERSION was here\n/usr/share/gems/gems/psych-2.0.0/lib/psych.rb:101: warning: already initialized constant Psych::LIBYAML_VERSION\n/usr/share/ruby/psych.rb:101: warning: previous definition of LIBYAML_VERSION was here\n", "stderr_lines": ["/usr/share/gems/gems/psych-2.0.0/lib/psych.rb:98: warning: already initialized constant Psych::VERSION", "/usr/share/ruby/psych.rb:98: warning: previous definition of VERSION was here", "/usr/share/gems/gems/psych-2.0.0/lib/psych.rb:101: warning: already initialized constant Psych::LIBYAML_VERSION", "/usr/share/ruby/psych.rb:101: warning: previous definition of LIBYAML_VERSION was here"], "stdout": "The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x64-mingw32, x86-mswin32. To add those platforms to the bundle, run bundle lock --add-platform x86-mingw32 x64-mingw32 x86-mswin32.\nFetching gem metadata from https://rubygems.org/..........\nFetching gem metadata from https://rubygems.org/.\nResolving dependencies.....\nRubyGems 2.0.14.1 is not threadsafe, so your gems will be installed one at a time. Upgrade to RubyGems 2.1.0 or higher to enable parallel gem installation.\nFetching rake 12.3.0\nInstalling rake 12.3.0\nFetching i18n 0.7.0\nInstalling i18n 0.7.0\nFetching minitest 5.11.3\nInstalling minitest 5.11.3\nFetching thread_safe 0.3.6\nInstalling thread_safe 0.3.6\nFetching tzinfo 1.2.5\nInstalling tzinfo 1.2.5\nFetching activesupport 4.2.8\nInstalling activesupport 4.2.8\nFetching builder 3.2.3\nInstalling builder 3.2.3\nFetching erubis 2.7.0\nInstalling erubis 2.7.0\nFetching mini_portile2 2.1.0\nInstalling mini_portile2 2.1.0\nFetching nokogiri 1.6.8.1\nInstalling nokogiri 1.6.8.1 with native extensions\nFetching rails-deprecated_sanitizer 1.0.3\nInstalling rails-deprecated_sanitizer 1.0.3\nFetching rails-dom-testing 1.0.9\nInstalling rails-dom-testing 1.0.9\nFetching crass 1.0.3\nInstalling crass 1.0.3\nFetching loofah 2.2.0\nInstalling loofah 2.2.0\nFetching rails-html-sanitizer 1.0.3\nInstalling rails-html-sanitizer 1.0.3\nFetching actionview 4.2.8\nInstalling actionview 4.2.8\nFetching rack 1.6.8\nInstalling rack 1.6.8\nFetching rack-test 0.6.3\nInstalling rack-test 0.6.3\nFetching actionpack 4.2.8\nInstalling actionpack 4.2.8\nFetching globalid 0.4.1\nInstalling globalid 0.4.1\nFetching activejob 4.2.8\nInstalling activejob 4.2.8\nFetching mini_mime 1.0.0\nInstalling mini_mime 1.0.0\nFetching mail 2.7.0\nInstalling mail 2.7.0\nFetching actionmailer 4.2.8\nInstalling actionmailer 4.2.8\nFetching actionpack-xml_parser 1.0.2\nInstalling actionpack-xml_parser 1.0.2\nFetching activemodel 4.2.8\nInstalling activemodel 4.2.8\nFetching arel 6.0.4\nInstalling arel 6.0.4\nFetching activerecord 4.2.8\nInstalling activerecord 4.2.8\nUsing public_suffix 2.0.5\nFetching addressable 2.5.2\nInstalling addressable 2.5.2\nUsing bundler 1.16.1\nFetching xpath 2.1.0\nInstalling xpath 2.1.0\nFetching capybara 2.18.0\nInstalling capybara 2.18.0\nFetching ffi 1.9.21\nInstalling ffi 1.9.21 with native extensions\nGem::Installer::ExtensionBuildError: ERROR: Failed to build gem native\nextension.\n\n /usr/bin/ruby extconf.rb\nchecking for ffi.h... no\nchecking for ffi.h in /usr/local/include,/usr/include/ffi... no\nchecking for shlwapi.h... no\nchecking for rb_thread_blocking_region()... yes\nchecking for rb_thread_call_with_gvl()... yes\nchecking for rb_thread_call_without_gvl()... yes\ncreating extconf.h\ncreating Makefile\n\nmake "DESTDIR="\nRunning autoreconf for libffi\n/home/redmine/.gem/ruby/gems/ffi-1.9.21/ext/ffi_c/libffi/autogen.sh: line 2:\nexec: autoreconf: не найден\nmake: ***\n["/home/redmine/.gem/ruby/gems/ffi-1.9.21/ext/ffi_c/libffi-x86_64-linux"/.libs/libffi_convenience.a]\nОшибка 127\n\n\nGem files will remain installed in /home/redmine/.gem/ruby/gems/ffi-1.9.21 for\ninspection.\nResults logged to /home/redmine/.gem/ruby/gems/ffi-1.9.21/ext/ffi_c/gem_make.out\n\nAn error occurred while installing ffi (1.9.21), and Bundler cannot continue.\nMake sure that gem install ffi -v '1.9.21' succeeds before bundling.\n\nIn Gemfile:\n selenium-webdriver was resolved to 2.53.4, which depends on\n childprocess was resolved to 0.8.0, which depends on\n ffi\n", "stdout_lines": ["The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x64-mingw32, x86-mswin32. To add those platforms to the bundle, run bundle lock --add-platform x86-mingw32 x64-mingw32 x86-mswin32.", "Fetching gem metadata from https://rubygems.org/..........", "Fetching gem metadata from https://rubygems.org/.", "Resolving dependencies.....", "RubyGems 2.0.14.1 is not threadsafe, so your gems will be installed one at a time. Upgrade to RubyGems 2.1.0 or higher to enable parallel gem installation.", "Fetching rake 12.3.0", "Installing rake 12.3.0", "Fetching i18n 0.7.0", "Installing i18n 0.7.0", "Fetching minitest 5.11.3", "Installing minitest 5.11.3", "Fetching thread_safe 0.3.6", "Installing thread_safe 0.3.6", "Fetching tzinfo 1.2.5", "Installing tzinfo 1.2.5", "Fetching activesupport 4.2.8", "Installing activesupport 4.2.8", "Fetching builder 3.2.3", "Installing builder 3.2.3", "Fetching erubis 2.7.0", "Installing erubis 2.7.0", "Fetching mini_portile2 2.1.0", "Installing mini_portile2 2.1.0", "Fetching nokogiri 1.6.8.1", "Installing nokogiri 1.6.8.1 with native extensions", "Fetching rails-deprecated_sanitizer 1.0.3", "Installing rails-deprecated_sanitizer 1.0.3", "Fetching rails-dom-testing 1.0.9", "Installing rails-dom-testing 1.0.9", "Fetching crass 1.0.3", "Installing crass 1.0.3", "Fetching loofah 2.2.0", "Installing loofah 2.2.0", "Fetching rails-html-sanitizer 1.0.3", "Installing rails-html-sanitizer 1.0.3", "Fetching actionview 4.2.8", "Installing actionview 4.2.8", "Fetching rack 1.6.8", "Installing rack 1.6.8", "Fetching rack-test 0.6.3", "Installing rack-test 0.6.3", "Fetching actionpack 4.2.8", "Installing actionpack 4.2.8", "Fetching globalid 0.4.1", "Installing globalid 0.4.1", "Fetching activejob 4.2.8", "Installing activejob 4.2.8", "Fetching mini_mime 1.0.0", "Installing mini_mime 1.0.0", "Fetching mail 2.7.0", "Installing mail 2.7.0", "Fetching actionmailer 4.2.8", "Installing actionmailer 4.2.8", "Fetching actionpack-xml_parser 1.0.2", "Installing actionpack-xml_parser 1.0.2", "Fetching activemodel 4.2.8", "Installing activemodel 4.2.8", "Fetching arel 6.0.4", "Installing arel 6.0.4", "Fetching activerecord 4.2.8", "Installing activerecord 4.2.8", "Using public_suffix 2.0.5", "Fetching addressable 2.5.2", "Installing addressable 2.5.2", "Using bundler 1.16.1", "Fetching xpath 2.1.0", "Installing xpath 2.1.0", "Fetching capybara 2.18.0", "Installing capybara 2.18.0", "Fetching ffi 1.9.21", "Installing ffi 1.9.21 with native extensions", "Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native", "extension.", "", " /usr/bin/ruby extconf.rb", "checking for ffi.h... no", "checking for ffi.h in /usr/local/include,/usr/include/ffi... no", "checking for shlwapi.h... no", "checking for rb_thread_blocking_region()... yes", "checking for rb_thread_call_with_gvl()... yes", "checking for rb_thread_call_without_gvl()... yes", "creating extconf.h", "creating Makefile", "", "make "DESTDIR="", "Running autoreconf for libffi", "/home/redmine/.gem/ruby/gems/ffi-1.9.21/ext/ffi_c/libffi/autogen.sh: line 2:", "exec: autoreconf: не найден", "make: ***", "["/home/redmine/.gem/ruby/gems/ffi-1.9.21/ext/ffi_c/libffi-x86_64-linux"/.libs/libffi_convenience.a]", "Ошибка 127", "", "", "Gem files will remain installed in /home/redmine/.gem/ruby/gems/ffi-1.9.21 for", "inspection.", "Results logged to /home/redmine/.gem/ruby/gems/ffi-1.9.21/ext/ffi_c/gem_make.out", "", "An error occurred while installing ffi (1.9.21), and Bundler cannot continue.", "Make sure that gem install ffi -v '1.9.21' succeeds before bundling.", "", "In Gemfile:", " selenium-webdriver was resolved to 2.53.4, which depends on", " childprocess was resolved to 0.8.0, which depends on", " ffi"]}

Is libffi installed on the server?

I am not sure how did you use bngsudheer.centos_base role. There were some recent updates. Please hvae something like this in your playbook:

  hosts: all
  vars:
    - centos_base_enable_epel: true
    - centos_base_fail2ban_configuration: true
    - centos_base_install_selinux_packages: true
    - centos_base_basic_packages: true
    - redmine_sql_database_name: "redmine"
    - redmine_sql_database_host: "localhost"
    - redmine_sql_username: "redmine"
    - redmine_sql_password: "password"
    - redmine_unicorn_port: 5777
  roles:
    - bngsudheer.centos_base
    - bngsudheer.redmine

The variables:
- centos_base_enable_epel: true
and
- centos_base_basic_packages: true
play key role.

Make sure you have bngsudheer.centos_base 1.6 is installed.

 ansible-galaxy install bngsudheer.centos_base -f

Can I close this issue? You just need to install the package which. Or perform the steps in my previous comment.

ivn86 commented

I can not check due to new issues. #24

ivn86 commented

All works! Please close issue. Thank you!