Project

General

Profile

Problem with Installation: gem install mysql won't work

Added by Iam new almost 14 years ago

Hi,
I am new to redmine and have problems with installation.

My working environment as asked in the thread "How to request help":
Ruby 1.8.7 (2008-08-11 patchlevel 72) [i586-linux]
Rails 2.3.8
openSuse 11.2 (i586)
MySQL 5.0.91
Webrick ???? (I actually don't know...)

I tried out step by step the installation procedure (http://www.redmine.org/wiki/redmine/RedmineInstall), but it is not possible to do the step 5 "RAILS_ENV=production rake db:migrate", I get

!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql.
rake aborted!
no such file to load -- mysql

with --trace I get
_** Invoke db:migrate (first_time)
  • Invoke environment (first_time)
  • Execute environment
    !!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql.
    rake aborted!
    no such file to load -- mysql
    /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:158:in `require'_
    and so on....

If I try
gem install mysql
I get

_ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.

/usr/bin/ruby extconf.rb
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._

I have already tried a lot of things (first I thought it was a problem with the standard mysql5.1 distribution that was installed, but with the 5.0.91 it doesn't work either) and searched in the forum and web. But it doesn't seem that a lot of people use suse... and apt-get doesn't work (proposed solution elsewhere)

Any suggestions would be great!
thanks :-)


Replies (12)

RE: Problem with Installation: gem install mysql won't work - Added by Felix Schäfer almost 14 years ago

Install the mysql-devel package (or whatever suse calls it) and everything necessary for gcc to work. The mysql gem has binary extensions that need to be compiled for your environment.

(you should also install rails 2.3.5, 2.3.8 is known to introduce some view problems in redmine).

RE: Problem with Installation: gem install mysql won't work - Added by Iam new over 13 years ago

Hi,
thanks for the fast response.
By searching in the web it seems that this mysql-devel packages are called lybmysqlclient... in Suse.
I tried to install one (I actually didn't know which) and I get the following:

rpm -ivh libmysqlclient16-5.1.36-6.7.2.i586.rpm
Preparing... ########################################### [100%]
package libmysqlclient16-5.1.36-6.8.8.i586 (which is newer than libmysqlclient16-5.1.36-6.7.2.i586) is already installed
file /usr/lib/libmysqlclient.so.16.0.0 from install of libmysqlclient16-5.1.36-6.7.2.i586 conflicts with file from package libmysqlclient16-5.1.36-6.8.8.i586

Is it possible that the installed package belongs to the mysql 5.1-version??? I am wondering because this one was preinstalled (by yast) and I just uninstalles it by yast and then manually installed the mysql 5.0... version.

Looking at the installed mysql-version I find at /usr/local/mysql-5.0.91/lib/mysql the following:
rw-r--r- 1 root root 1758 25. Jun 12:40 libdbug.a
rw-r--r- 1 root root 51444 25. Jun 12:40 libheap.a
rw-r--r- 1 root root 387462 25. Jun 12:40 libmyisam.a
rw-r--r- 1 root root 29982 25. Jun 12:40 libmyisammrg.a
rw-r--r- 1 root root 556546 25. Jun 12:40 libmysqlclient.a
rwxr-xr-x 1 root root 1013 25. Jun 12:40 libmysqlclient.la
lrwxrwxrwx 1 root root 24 25. Jun 12:40 libmysqlclient.so -> libmysqlclient.so.15.0.0
lrwxrwxrwx 1 root root 24 25. Jun 12:40 libmysqlclient.so.15 -> libmysqlclient.so.15.0.0
-rwxr-xr-x 1 root root 471463 25. Jun 12:40 libmysqlclient.so.15.0.0
-rw-r--r-
1 root root 296064 25. Jun 12:40 libmystrings.a
rw-r--r- 1 root root 339346 25. Jun 12:40 libmysys.a
rw-r--r- 1 root root 7882 25. Jun 12:40 libvio.a

For any ideas I would be very thankful!

Best regards!

RE: Problem with Installation: gem install mysql won't work - Added by Iam new over 13 years ago

Oh, I finally got a solution to this (part of the problem).

Hopefully it will be useful to others:

sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config

As gem list confirms:

actionmailer (2.3.8, 2.3.5)
actionpack (2.3.8, 2.3.5)
activerecord (2.3.8, 2.3.5)
activeresource (2.3.8, 2.3.5)
activesupport (2.3.8, 2.3.5)
mysql (2.8.1)
postgres-pr (0.6.3)
rack (1.0.1)
rails (2.3.5)
rake (0.8.7)
rubygems-update (1.3.7)

Still, the step "RAILS_ENV=production rake db:migrate" does not work, I get:

"RAILS_ENV=production rake db:migrate --trace
(in /bin/redmine)
  • Invoke db:migrate (first_time)
  • Invoke environment (first_time)
  • Execute environment
    rake aborted!
    Object is not missing constant Project!
    /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:417:in `load_missing_constant'
    /usr/lib/ruby/gems/1.8/gems/........."

I continue my search for answers....

RE: Problem with Installation: gem install mysql won't work - Added by Felix Schäfer over 13 years ago

Did you get the error while starting off of a fresh (i.e. empty) db?

RE: Problem with Installation: gem install mysql won't work - Added by Iam new over 13 years ago

yes, it's an empty one. I haven't been able to run redmine. I am just trying to install it.

Do I have to fill the db with somethign first????

Any other ideas or suggestions?

I am so frustrated that I am looking for alternatives ... (trac, foswiki, etc.)
It's such a pity, but I can't change the environment (opensuse) :-(

RE: Problem with Installation: gem install mysql won't work - Added by Felix Schäfer over 13 years ago

Can you please post your database.yml? Please put it in < pre> < /pre> (spaces must be removed!) tags so that the formatting is kept.

RE: Problem with Installation: gem install mysql won't work - Added by Iam new over 13 years ago

MySQL (default setup).  Versions 4.1 and 5.0 are recommended.
#
# Get the fast C bindings:
#   gem install mysql
#   (on OS X: gem install mysql -- --include=/usr/local/lib)
# And be sure to use new-style password hashing:
#   http://dev.mysql.com/doc/refman/5.0/en/old-client.html

production:
  adapter: mysql
  database: redmine
  host: localhost
  username: redmine
  password: my_password
  encoding: utf8

development:
  adapter: mysql
  database: redmine_development
  host: localhost
  username: root
  password:
  encoding: utf8

test:
  adapter: mysql
  database: redmine_test
  host: localhost
  username: root
  password:
  encoding: utf8

test_pgsql:
  adapter: postgresql
  database: redmine_test
  host: localhost
  username: postgres
  password: "postgres" 

test_sqlite3:
  adapter: sqlite3
  database: db/test.db

Is this ok? I didn't realize what you meant with spaces must be removed...

RE: Problem with Installation: gem install mysql won't work - Added by Felix Schäfer over 13 years ago

Iam new wrote:

Is this ok? I didn't realize what you meant with spaces must be removed…

The spaces in the tags, you posted it correctly :-) Try removing all but the production environment, I think the postgres command in the test_pgsql environment might cause the problem. Try with this file:

MySQL (default setup).  Versions 4.1 and 5.0 are recommended.
#
# Get the fast C bindings:
#   gem install mysql
#   (on OS X: gem install mysql -- --include=/usr/local/lib)
# And be sure to use new-style password hashing:
#   http://dev.mysql.com/doc/refman/5.0/en/old-client.html

production:
  adapter: mysql
  database: redmine
  host: localhost
  username: redmine
  password: my_password
  encoding: utf8

#development:
#  adapter: mysql
#  database: redmine_development
#  host: localhost
#  username: root
#  password:
#  encoding: utf8
#
#test:
#  adapter: mysql
#  database: redmine_test
#  host: localhost
#  username: root
#  password:
#  encoding: utf8
#
#test_pgsql:
#  adapter: postgresql
#  database: redmine_test
#  host: localhost
#  username: postgres
#  password: "postgres" 
#
#test_sqlite3:
#  adapter: sqlite3
#  database: db/test.db

RE: Problem with Installation: gem install mysql won't work - Added by Iam new over 13 years ago

Just tried, but same result:

RAILS_ENV=production rake db:migrate --trace
(in /bin/redmine)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
Object is not missing constant Project!
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:417:in `load_missing_constant'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:in `const_missing'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:92:in `const_missing'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:98:in `send'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:98:in `const_missing'
/bin/redmine/app/models/attachment.rb:36
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:158:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:265:in `require_or_load_without_engine_additions'
/bin/redmine/vendor/plugins/engines/lib/engines/rails_extensions/dependencies.rb:132:in `require_or_load'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:425:in `load_missing_constant'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:in `const_missing'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:92:in `const_missing'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:437:in `load_missing_constant'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:in `const_missing'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:437:in `load_missing_constant'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:in `const_missing'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:437:in `load_missing_constant'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:in `const_missing'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:437:in `load_missing_constant'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:in `const_missing'
/bin/redmine/vendor/plugins/acts_as_attachable/lib/acts_as_attachable.rb:33:in `acts_as_attachable'
/bin/redmine/app/models/message.rb:22
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:158:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:265:in `require_or_load_without_engine_additions'
/bin/redmine/vendor/plugins/engines/lib/engines/rails_extensions/dependencies.rb:132:in `require_or_load'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:425:in `load_missing_constant'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:in `const_missing'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:92:in `const_missing'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/inflector.rb:361:in `constantize'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/inflector.rb:360:in `each'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/inflector.rb:360:in `constantize'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/string/inflections.rb:162:in `constantize'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/observer.rb:157:in `observed_class'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/observer.rb:183:in `observed_classes'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/observer.rb:166:in `initialize'
/usr/lib/ruby/1.8/singleton.rb:94:in `new'
/usr/lib/ruby/1.8/singleton.rb:94:in `instance'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/observer.rb:38:in `instantiate_observers'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/observer.rb:36:in `each'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/observer.rb:36:in `instantiate_observers'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:15:in `define_dispatcher_callbacks'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:182:in `call'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:182:in `evaluate_method'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:166:in `call'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:90:in `run'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:90:in `each'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:90:in `send'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:90:in `run'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:276:in `run_callbacks'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:51:in `send'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:51:in `run_prepare_callbacks'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:631:in `prepare_dispatcher'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:185:in `process'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:113:in `send'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:113:in `run'
/bin/redmine/config/environment.rb:20
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/tasks/misc.rake:4
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:607:in `invoke_prerequisites'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `invoke_prerequisites'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:596:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
/usr/bin/rake:19:in `load'
/usr/bin/rake:19

Just in case, my actual environment

*** LOCAL GEMS ***

actionmailer (2.3.5)
actionpack (2.3.5)
activerecord (2.3.5)
activeresource (2.3.5)
activesupport (2.3.5)
mysql (2.8.1)
rack (1.0.1)
rails (2.3.5)
rake (0.8.7)
rubygems-update (1.3.7)

RE: Problem with Installation: gem install mysql won't work - Added by data recovery over 13 years ago

The mysql has binary extensions that need to be compiled for your environment. You should also install rails 2.3.5, 2.3.8 to introduce some view problems in redmine.
Regards
data recovery
http://www.datadoctor.biz

RE: Problem with Installation: gem install mysql won't work - Added by Iam new over 13 years ago

Hi,
thanks for the answer.
It was posted before, to try out with rails 2.3.5 (also). I have now tried so many different combinations, that I didn't post them all ;-) Anyway, it doesn't seem to be a problem of rails 2.3.5 and 2.3.8
Same result as above having the environment:

*** LOCAL GEMS ***

actionmailer (2.3.8, 2.3.5)
actionpack (2.3.8, 2.3.5)
activerecord (2.3.8, 2.3.5)
activeresource (2.3.8, 2.3.5)
activesupport (2.3.8, 2.3.5)
mysql (2.8.1)
rack (1.1.0, 1.0.1)
rails (2.3.8, 2.3.5)
rake (0.8.7)
rubygems-update (1.3.7)

Any other suggestions what could be wrong???

RE: Problem with Installation: gem install mysql won't work - Added by lone ranger over 13 years ago

Just make sure that you have redmine-mysql installed in addition. This solved it for me. I am running

Ubuntu 10.04
*** LOCAL GEMS ***

actionmailer (2.3.5)
actionpack (2.3.5)
activerecord (2.3.5)
activeresource (2.3.5)
activesupport (3.0.0, 2.3.5)
builder (2.1.2)
rack (1.0.1)
rails (2.3.5)
rake (0.8.7)

To install

sudo aptitude install redmine-mysql

I hope it works for you folks

    (1-12/12)