Prawn gem error


#1

Hi,

I want to use Dradis to CentOS 7.0 but I’ve an error to prawn gem version.

Gem list : Prawn 2.1.0

I’ve this issue with setup bin/setup:

== Installing dependencies ==
The git source git://github.com/dradis/dradis-projects.git is not yet checked out. Please run `bundle install` before trying to start your application
Fetching git://github.com/dradis/dradis-projects.git
Fetching git://github.com/dradis/dradis-theme_snowcrash.git
Fetching git://github.com/dradis/dradis-brakeman.git
Fetching git://github.com/dradis/dradis-metasploit.git
Resolving dependencies...
Some gems seem to be missing from your vendor/cache directory.
Bundler could not find compatible versions for gem "prawn":
  In Gemfile:
    dradis-pdf_export was resolved to 3.2.1, which depends on
      prawn (~> 0.15.0)

Could not find gem 'prawn (~> 0.15.0)', which is required by gem 'dradis-pdf_export', in any of the sources.

Do you have a solution ?

Thanks


#2

Hi @trasla,
Are you using the instructions here? http://dradisframework.org/documentation/install_git.html

Your error mentions:

Please run bundle install before trying to start your application

Can you walk through the install steps in the guide linked above? Make sure that the bundle install command (#3) succeeds before running ./bin/setup (#4). Check out the troubleshooting steps at the bottom of the guide as well if you run into any roadblocks.


#3

Hi @rachkor,

Bundle install generate the same error message:

Bundler could not find compatible versions for gem "prawn":
  In Gemfile:
    dradis-pdf_export was resolved to 3.2.1, which depends on
      prawn (~> 0.15.0)

Do you have a solution for this gem ?

Thanks


#5

@trasla, I did some digging on this question, are you working on a brand new install from git or with an older version of Dradis? It looks like you may be working with the code from the legacy repo instead of the latest code here: https://github.com/dradis/dradis-ce

Can you confirm that you’ve cloned the dradis-ce repo linked above on your local system? Then, git pull the latest changes from and try the steps in this guide again: http://dradisframework.org/documentation/install_git.html


#6

@rachkor, I use this : https://github.com/dradis/dradis-legacy#getting-started-git-release-recommended

With the dradis-ce repo, I have other errors:

./bin/setup

  Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /usr/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
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.

An error occurred while installing mysql2 (0.3.18), and Bundler cannot continue. Make sure thatgem install mysql2 -v ‘0.3.18’succeeds before bundling.

Could not find dradis-calculator_cvss-3.0.1 in any of the sources
Runbundle installto install missing gems.

Bundle install:

`Rubygems 2.0.14 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.
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /usr/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
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}/lib64
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/usr/bin/ruby
        --with-mysql-dir
        --without-mysql-dir
        --with-mysql-include
        --without-mysql-include=${mysql-dir}/include
        --with-mysql-lib
        --without-mysql-lib=${mysql-dir}/
        --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}/
        --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/admin/.gem/ruby/gems/mysql2-0.3.18 for inspection.
Results logged to /home/admin/.gem/ruby/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.`

Others errors:

Using rspec-mocks 3.4.1
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /usr/bin/ruby extconf.rb
checking for ruby/thread.h... 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.


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.

 

>>

gem install mysql2 -v '0.3.18'
Building native extensions.  This could take a while...
ERROR:  Error installing mysql2:
        ERROR: Failed to build gem native extension.

    /usr/bin/ruby extconf.rb

EDIT:

After installing MariaDB devel and Ruby 2.2.2 with centos-sclo-rh repo and bundle install, I have this error:

Rubygems 2.0.14 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.

== Preparing database ==
rake aborted!
LoadError: cannot load such file -- mysql2/mysql2
/usr/local/share/gems/gems/mysql2-0.3.18/lib/mysql2.rb:31:in `require'
/usr/local/share/gems/gems/mysql2-0.3.18/lib/mysql2.rb:31:in `<top (required)>'
/usr/local/share/gems/gems/bundler-1.13.0/lib/bundler/runtime.rb:91:in `require'
/usr/local/share/gems/gems/bundler-1.13.0/lib/bundler/runtime.rb:91:in `block (2 levels) in require'
/usr/local/share/gems/gems/bundler-1.13.0/lib/bundler/runtime.rb:86:in `each'
/usr/local/share/gems/gems/bundler-1.13.0/lib/bundler/runtime.rb:86:in `block in require'
/usr/local/share/gems/gems/bundler-1.13.0/lib/bundler/runtime.rb:75:in `each'
/usr/local/share/gems/gems/bundler-1.13.0/lib/bundler/runtime.rb:75:in `require'
/usr/local/share/gems/gems/bundler-1.13.0/lib/bundler.rb:106:in `require'
/data/dradis-ce/config/application.rb:12:in `<top (required)>'
/data/dradis-ce/Rakefile:4:in `require'
/data/dradis-ce/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)

Now I use ./bin/setup to resolv one part errors. But I have yet database errors:

 ./bin/setup
== Cloning core Dradis add-ons at /data/dradis-ce/.. ==
fatal: destination path 'dradis-calculator_cvss' already exists and is not an empty directory.
fatal: destination path 'dradis-calculator_dread' already exists and is not an empty directory.
fatal: destination path 'dradis-csv' already exists and is not an empty directory.
fatal: destination path 'dradis-html_export' already exists and is not an empty directory.
fatal: destination path 'dradis-mediawiki' already exists and is not an empty directory.
fatal: destination path 'dradis-vulndb' already exists and is not an empty directory.
fatal: destination path 'dradis-acunetix' already exists and is not an empty directory.
fatal: destination path 'dradis-brakeman' already exists and is not an empty directory.
fatal: destination path 'dradis-burp' already exists and is not an empty directory.
fatal: destination path 'dradis-metasploit' already exists and is not an empty directory.
fatal: destination path 'dradis-nessus' already exists and is not an empty directory.
fatal: destination path 'dradis-nexpose' already exists and is not an empty directory.
fatal: destination path 'dradis-nikto' already exists and is not an empty directory.
fatal: destination path 'dradis-nmap' already exists and is not an empty directory.
fatal: destination path 'dradis-ntospider' already exists and is not an empty directory.
fatal: destination path 'dradis-openvas' already exists and is not an empty directory.
fatal: destination path 'dradis-qualys' already exists and is not an empty directory.
fatal: destination path 'dradis-plugins' already exists and is not an empty directory.
fatal: destination path 'dradis-projects' already exists and is not an empty directory.
== Installing dependencies ==
The Gemfile's dependencies are satisfied

== Copying sample files ==

== Preparing database ==
rake aborted!
LoadError: cannot load such file -- mysql2/mysql2
/usr/local/share/gems/gems/mysql2-0.3.18/lib/mysql2.rb:31:in `require'
/usr/local/share/gems/gems/mysql2-0.3.18/lib/mysql2.rb:31:in `<top (required)>'
/usr/local/share/gems/gems/bundler-1.13.0/lib/bundler/runtime.rb:91:in `require'
/usr/local/share/gems/gems/bundler-1.13.0/lib/bundler/runtime.rb:91:in `block (2 levels) in require'
/usr/local/share/gems/gems/bundler-1.13.0/lib/bundler/runtime.rb:86:in `each'
/usr/local/share/gems/gems/bundler-1.13.0/lib/bundler/runtime.rb:86:in `block in require'
/usr/local/share/gems/gems/bundler-1.13.0/lib/bundler/runtime.rb:75:in `each'
/usr/local/share/gems/gems/bundler-1.13.0/lib/bundler/runtime.rb:75:in `require'
/usr/local/share/gems/gems/bundler-1.13.0/lib/bundler.rb:106:in `require'
/data/dradis-ce/config/application.rb:12:in `<top (required)>'
/data/dradis-ce/Rakefile:4:in `require'
/data/dradis-ce/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)

== Removing old logs and tempfiles ==

== Restarting application server ==

#7

It looks like all of the error messages are referencing the mysql gem which likely means a system-specific dependency issue. Have you searched StackOverflow and other forums for details on installing this gem on your OS? I found this which might be a good place to start: http://stackoverflow.com/questions/3754662/errors-installing-mysql2-gem-via-the-bundler


#8

Also, @trasla, what version of Ruby are you using (ruby -v)?


#9

Hi @rachkor,

Yes I try it without results.

@etd,

Hi,

The version is ruby 2.0.0p598 (2014-11-13) [x86_64-linux]

Thanks

EDIT :
gem install mysql2 -v ‘0.3.11’
ERROR: Error installing mysql2:
invalid gem: package is corrupt, exception while verifying: undefined method `path2class’ for #Psych::ClassLoader:0x000000021de9b0 (NoMethodError) in /usr/local/share/gems/cache/mysql2-0.3.11.gem


#10

It seems that the downloaded .gem file is corrupt for some reason, can you just delete it from the cache and try redownloading again?

/usr/local/share/gems/cache/mysql2-0.3.11.gem

Also, the latest Dradis repo is using version 0.3.18 of the gem: