# Prawn gem error

**URL:** <https://discuss.dradis.com/t/prawn-gem-error/357>\
**Category:** Community Edition\
**Created:** [September 7, 2016, 9:52am UTC](https://discuss.dradis.com/t/prawn-gem-error/357 "2016-09-07T09:52:54Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![trasla](https://avatars.discourse-cdn.com/v4/letter/t/35a633/32.png) [@trasla](https://discuss.dradis.com/u/trasla)\
**Post date:** [September 7, 2016, 9:52am UTC](https://discuss.dradis.com/t/prawn-gem-error/357/1 "2016-09-07T09:52:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rachkor](https://yyz1.discourse-cdn.com/flex035/user_avatar/discuss.dradis.com/rachkor/32/51_2.png) [@rachkor](https://discuss.dradis.com/u/rachkor)\
**Post date:** [September 7, 2016, 1:21pm UTC](https://discuss.dradis.com/t/prawn-gem-error/357/2 "2016-09-07T13:21:27Z")

</div>

Hi @trasla,  
Are you using the instructions here? [http://dradisframework.org/documentation/install\_git.html](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.

---

<div class="post-metadata">

**Author:** ![trasla](https://avatars.discourse-cdn.com/v4/letter/t/35a633/32.png) [@trasla](https://discuss.dradis.com/u/trasla)\
**Post date:** [September 8, 2016, 7:03am UTC](https://discuss.dradis.com/t/prawn-gem-error/357/3 "2016-09-08T07:03:43Z")

</div>

> [@trasla](#):
>
> 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)

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

---

<div class="post-metadata">

**Author:** ![rachkor](https://yyz1.discourse-cdn.com/flex035/user_avatar/discuss.dradis.com/rachkor/32/51_2.png) [@rachkor](https://discuss.dradis.com/u/rachkor)\
**Post date:** [September 8, 2016, 5:01pm UTC](https://discuss.dradis.com/t/prawn-gem-error/357/5 "2016-09-08T17:01:22Z")

</div>

@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](https://github.com/dradis/dradis-legacy) instead of the latest code here: [GitHub - dradis/dradis-ce: Dradis Framework: Colllaboration and reporting for IT Security teams](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: [Installing Dradis from Git | Dradis Framework](http://dradisframework.org/documentation/install_git.html)

---

<div class="post-metadata">

**Author:** ![trasla](https://avatars.discourse-cdn.com/v4/letter/t/35a633/32.png) [@trasla](https://discuss.dradis.com/u/trasla)\
**Post date:** [September 9, 2016, 8:54am UTC](https://discuss.dradis.com/t/prawn-gem-error/357/6 "2016-09-09T08:54:57Z")

</div>

@rachkor, I use this : [GitHub - dradis/dradis-legacy: This is a LEGACY repo head to](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 that `gem install mysql2 -v ‘0.3.18’` succeeds before bundling.`

`Could not find dradis-calculator_cvss-3.0.1 in any of the sources`  
`Run `bundle install` to 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 ==

```

---

<div class="post-metadata">

**Author:** ![rachkor](https://yyz1.discourse-cdn.com/flex035/user_avatar/discuss.dradis.com/rachkor/32/51_2.png) [@rachkor](https://discuss.dradis.com/u/rachkor)\
**Post date:** [September 12, 2016, 1:34pm UTC](https://discuss.dradis.com/t/prawn-gem-error/357/7 "2016-09-12T13:34:10Z")

</div>

> [@trasla](#):
>
> 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.

It looks like all of the error messages are referencing the `mysql` gem which likely means [a system-specific dependency issue](http://dradisframework.org/documentation/install_git.html#troubleshooting). 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: [mysql - Errors Installing mysql2 gem via the Bundler - Stack Overflow](http://stackoverflow.com/questions/3754662/errors-installing-mysql2-gem-via-the-bundler)

---

<div class="post-metadata">

**Author:** ![etd](https://yyz1.discourse-cdn.com/flex035/user_avatar/discuss.dradis.com/etd/32/5_2.png) [@etd](https://discuss.dradis.com/u/etd)\
**Post date:** [September 15, 2016, 11:46pm UTC](https://discuss.dradis.com/t/prawn-gem-error/357/8 "2016-09-15T23:46:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![trasla](https://avatars.discourse-cdn.com/v4/letter/t/35a633/32.png) [@trasla](https://discuss.dradis.com/u/trasla)\
**Post date:** [September 16, 2016, 2:09pm UTC](https://discuss.dradis.com/t/prawn-gem-error/357/9 "2016-09-16T14:09:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![etd](https://yyz1.discourse-cdn.com/flex035/user_avatar/discuss.dradis.com/etd/32/5_2.png) [@etd](https://discuss.dradis.com/u/etd)\
**Post date:** [September 22, 2016, 8:19am UTC](https://discuss.dradis.com/t/prawn-gem-error/357/10 "2016-09-22T08:19:07Z")

</div>

> [@trasla](#):
>
> ERROR: Error installing mysql2:  
> invalid gem: package is corrupt, exception while verifying: undefined method `path2class’ for #

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:

> <https://github.com/dradis/dradis-ce/blob/main/Gemfile#L73>
