0
votes

I am currently installing Redmine and following these steps (And I am in installation process-> step2 ) and when I am trying to do bundle install --without development test rmagick I got error as bellow .

OUTPUT

$sudo bundle install --without development test rmagick

Fetching gem metadata from http://rubygems.org/....... Using rake (0.9.2.2) Using activesupport (2.3.14)
Using rack (1.1.3) Using actionpack (2.3.14)
Using actionmailer (2.3.14) Using activerecord (2.3.14)
Using activeresource (2.3.14) Using coderay (1.0.7) Using fastercsv (1.5.5) Using i18n (0.4.2) Installing mysql (2.8.1) with native extensions Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /usr/bin/ruby1.8 extconf.rb --with-mysql-config=/usr/local/mysql/bin/mysql_config extconf.rb:10: command not found: /usr/local/mysql/bin/mysql_config --cflags

* 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.8
--with-mysql-config

Gem files will remain installed in /var/lib/gems/1.8/gems/mysql-2.8.1 for inspection. Results logged to /var/lib/gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out

An error occured while installing mysql (2.8.1), and Bundler cannot continue. Make sure that gem install mysql -v '2.8.1' succeeds before bundling.

Then I followed THIS tutorial and removed .bundle/config and tried again but its still not working .

and also THIS one also not helped(same error) .

Here is the CAT of /var/lib/gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out

enter image description here

UPDATE:1

But I do not have the folder mysql folder in /usr/local/ and also I can not locate bin/mysql_config



UPDATE:2

I over come the first problem(mysql problem it was a path issue) and I end up with another : Please check :

sudo bundle install --without development test rmagick    
Fetching gem metadata from http://rubygems.org/.......    
Using rake (0.9.2.2) 
Using activesupport (2.3.14) 
Using rack (1.1.3) 
Using actionpack (2.3.14) 
Using actionmailer (2.3.14) 
Using activerecord (2.3.14) 
Using activeresource (2.3.14) 
Using coderay (1.0.7) 
Using fastercsv (1.5.5) 
Using i18n (0.4.2) 
Using mysql (2.8.1) 
Using net-ldap (0.3.1) 
Installing pg (0.14.0) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /usr/bin/ruby1.8 extconf.rb 
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again with
 --with-pg-config=/path/to/pg_config
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** 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.8
    --with-pg
    --without-pg
    --with-pg-dir
    --without-pg-dir
    --with-pg-include
    --without-pg-include=${pg-dir}/include
    --with-pg-lib
    --without-pg-lib=${pg-dir}/lib
    --with-pg-config
    --without-pg-config
    --with-pg_config
    --without-pg_config


Gem files will remain installed in /var/lib/gems/1.8/gems/pg-0.14.0 for inspection.
Results logged to /var/lib/gems/1.8/gems/pg-0.14.0/ext/gem_make.out
An error occured while installing pg (0.14.0), and Bundler cannot continue.
Make sure that `gem install pg -v '0.14.0'` succeeds before bundling.
4

4 Answers

3
votes

Notice it says "command not found: .../mysql_config" That means its trying to run the mysql_config program, but it isn't there (either doesn't exist on your system, or is installed somewhere else). It even guesses correctly at the problem "probably lack of necessary libraries and/or headers". Rubygems doesn't know why it failed, only that it failed (because this happens when running the makefile, and Rubygems doesn't know about specific build issues and dependencies for each of its gems), but it logs all the information for you to look into it. Notice it says to check the '/var/lib/gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out' file for more information. You could cat /var/lib/gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out to see more, but at this point it seems pretty clear that you're missing mysql.

I don't know how to install mysql for your system, but there should be some kind of package manager which will do it for you. I know apt-get is pretty common, and I think Ubuntu has something like synaptic, and I've also heard of one called pacman. Whatever one you use to install things on your system, it should be able to install mysql for you, so I'd start there.

1
votes

You probably need to install the mysql server first.

1
votes

Run this and after that run bundle install

sudo apt-get install build-essential zlib1g-dev libssl-dev libreadline-dev libruby1.9

0
votes

simple for your problem look this step

1>>>/opt/metasploit/msf3# gem unpack bundle install Unpacked gem: '/opt/metasploit/msf3/bundle-0.0.1' ERROR: Gem 'install' not installed nor fetchable.

2>>>

root@bt:/opt/metasploit/msf3# bundle install Fetching gem metadata from https://rubygems.org/......... Fetching gem metadata from https://rubygems.org/.. Using rake (10.1.0) Using i18n (0.6.5) Using multi_json (1.0.4) Using activesupport (3.2.14) Using builder (3.0.4) Using activemodel (3.2.14) Using arel (3.0.2) Using tzinfo (0.3.37) Using activerecord (3.2.14) Using database_cleaner (1.1.1) Using diff-lcs (1.2.4) Using factory_girl (4.2.0) Using fivemat (1.2.1) Using json (1.8.0) Installing pg (0.16.0) Installing metasploit_data_models (0.16.6) Installing mini_portile (0.5.1) Installing msgpack (0.5.5) Installing network_interface (0.0.1) Installing nokogiri (1.6.0) Installing packetfu (1.1.9) Installing pcaprub (0.11.3) Installing redcarpet (3.0.0) Installing robots (0.10.1) Installing rspec-core (2.14.5) Installing rspec-expectations (2.14.2) Installing rspec-mocks (2.14.3) Installing rspec (2.14.1) Installing shoulda-matchers (2.3.0) Installing simplecov-html (0.5.3) Installing simplecov (0.5.4) Installing timecop (0.6.3) Installing yard (0.8.7) Using bundler (1.3.5) Your bundle is complete! Use bundle show [gemname] to see where a bundled gem is installed.

3>>>succeess your metasploit work

root@bt:/opt/metasploit/msf3# msfconsole NOTICE: ALTER TABLE will create implicit sequence "vulns_refs_id_seq" for serial column "vulns_refs.id" NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index "vulns_refs_pkey" for table "vulns_refs" NOTICE: CREATE TABLE will create implicit sequence "task_creds_id_seq" for serial column "task_creds.id" NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "task_creds_pkey" for table "task_creds" NOTICE: CREATE TABLE will create implicit sequence "task_hosts_id_seq" for serial column "task_hosts.id" NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "task_hosts_pkey" for table "task_hosts" NOTICE: CREATE TABLE will create implicit sequence "task_services_id_seq" for serial column "task_services.id" NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "task_services_pkey" for table "task_services" NOTICE: ALTER TABLE will create implicit sequence "hosts_tags_id_seq" for serial column "hosts_tags.id" NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index "hosts_tags_pkey" for table "hosts_tags" NOTICE: CREATE TABLE will create implicit sequence "task_sessions_id_seq" for serial column "task_sessions.id" NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "task_sessions_pkey" for table "task_sessions" _ _ / \ /\ __ _ __ // _ | |\ / | \ \ _ | | / \ _ \ \ | | /| | | \ |- -| /\ / _\ | -/ | || | || | |- -| |_| | | | |_ | |_ / -\ \ \ | | | | __/| | | |_ |/ |_/ __/ /\ \_/ / __| |_\ _\

   =[ metasploit v4.9.0-dev [core:4.9 api:1.0]

+ -- --=[ 1236 exploits - 676 auxiliary - 197 post + -- --=[ 326 payloads - 31 encoders - 8 nops

i hope your problem solved