Problem with Bundler

Added by Otto Darek over 7 years ago

If I start bundler, it gives an error: “Make sure that `gem install mysql -v '2.8.1'` succeeds before bundling.”
But I have MySQL-Server installed with more than one instance.
How can I fix this problem? :)

Replies (8)

RE: Problem with Bundler - Added by Radhakrishna M over 7 years ago

If u are in windows you need to do some extra configuration.

Download Mysql-connector-c--c-noinstall-6.0.2-win32 from

http://dev.mysql.com/downloads/connector/c/

Extract it. Copy libmysql.dll file from /lib folder and Paste it in the C:\RailsInstaller\Ruby1.9.3\bin folder

Now install “mysql2” gem

Go to command prompt and type

gem install mysql2

On successful installation , Rails application will be created and bind with MYSQL database.

RE: Problem with Bundler - Added by Otto Darek over 7 years ago

Thank you, but i use Linux (openSuSE 12)

RE: Problem with Bundler - Added by Radhakrishna M over 7 years ago

Try this

$ sudo apt-get install libmysql-ruby libmysqlclient-dev
$ gem install mysql

Delete file Gemfile.lock

$ bundle install

RE: Problem with Bundler - Added by Otto Darek over 7 years ago

But once, i have installed mysql. In MySQL we have very important DBs. Can't it crash, if i install mysql via gem again?

RE: Problem with Bundler - Added by Radhakrishna M over 7 years ago

its just for gem installation, wont reinstall Mysql

keep the DB backup for safety anyway

RE: Problem with Bundler - Added by Otto Darek over 7 years ago

Thank you very much. Next problem :P
How can i change the MySQL-Server-Directory

  1. RAILS_ENV=production rake db:migrate
    rake aborted!
    Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)
    /root/redmine/redmine-2.3.1/app/models/issue_relation.rb:73
    /root/redmine/redmine-2.3.1/lib/redmine/helpers/gantt.rb:28
    /root/redmine/redmine-2.3.1/lib/redmine.rb:51
    /root/redmine/redmine-2.3.1/config/initializers/30-redmine.rb:4
    /root/redmine/redmine-2.3.1/config/environment.rb:14
    Tasks: TOP => db:migrate => environment
    (See full trace by running task with --trace)
  2. locate mysql.sock
    /var/lib/mysql/mysql.sock
    /var/lib/mysql2/mysql.sock
    /var/lib/mysql3/mysql.sock
    /var/lib/mysql4/mysql.sock
  3. cat config/database.yml
    production:
    adapter: mysql
    database: redmine
    host: localhost
    port: 3306
    username: redmine
    password: **
    encoding: utf8

RE: Problem with Bundler - Added by Radhakrishna M over 7 years ago

add this line to databse.yml file

.
.
password: xx
socket: /var/run/mysql/mysql.sock

RE: Problem with Bundler - Added by Otto Darek over 7 years ago

Thank you for your support.
It’s runs perfectly.
For OpenSuSE I have made a init-script:

#!/bin/bash
j# Autor: Daniel Kmiotek
j### BEGIN INIT INFO
j# Provides: redmine
j# Required-Start: $network $remote_fs
j# Required-Stop: $network $remote_fs
j# Default-Start: 3 5
j# Default-Stop: 0 1 2 6
j# Description: Start the redmine daemon
j### END INIT INFO

. /etc/rc.status
RED_BIN=/usr/bin/redmine
RED_PID=/srv/www/redmine/tmp/pids/server.pid
rc_reset
case "$1" in
start)
echo -n "Starte REDMINE-Dienst"
startproc -f /usr/bin/redmine
rc_status -v
;;
stop)
echo -n "Beende READMINT-Dienst"
killproc -p $RED_PID -INT /usr/bin/ruby
rc_status -v
;;
forcestop)
kill -SIGKILL $(cat $RED_PID)
echo -n "Beende READMINT-Dienst"
rc_status -v
;;
status)
echo -n "Checking redmine"
checkproc -p $RED_PID /usr/bin/ruby
rc_status -v
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: $0 {start|stop|forcestop|status|restart}"
;;
esac

(1-8/8)