简体   繁体   中英

Redmine installation: Mysql gem say undefined symbol: mysql_init

I'm trying to install redmine on a OVH mutualized server but i'm block by a MySQL gem issue. OVH servers does not allow external network connection. I've downloaded and installed manually all gems with dependencies required for Redmine.

I've installed without any problems MySQL gems: - mysql 2.8.1 - mysql2 0.3.11

For the installation I needed to specify mysql lib and include folders path because it's a mutualized installation and a non standard layout:

gem install mysql-2.8.1.gem
    --no-rdoc
    --no-ri
    --
    --with-mysql-config=/usr/bin/mysql_config
    --without-mysql-dir
    --with-mysql-lib=/usr/lib/mysql
    --with-mysql-include=/usr/include/mysql

gem install mysql2-0.3.11.gem
    --no-rdoc
    --no-ri
    --
    --with-mysql-config=/usr/bin/mysql_config
    --without-mysql-dir
    --with-opt-lib=/usr/lib/mysql
    --with-opt-include=/usr/include/mysql

With these 2 commands, I get no error and a message 1 gem insalled .

After that funny manual package installation process, I've followed the Redmine installation tutorial to initialize my environment.

First command, generate secret token: rake generate_secret_token Second command, build database schema: RAILS_ENV=production rake db:migrate

The first one work perfectly, but the second send me this error:

ruby: symbol lookup error: /MYHOMEFOLDER/gems/mysql-2.8.1/lib/mysql_api.so: undefined symbol: mysql_init

Is there someone who knows how I can resolve this problem?

If you're using ruby1.9 then use the mysql2 gem.
If you're using ruby1.8 then use the mysql gem.

So, if you're using 1.9, in your config/database.yml

production:
  adapter: mysql2

and :

gem install mysql2

If you're running Redmine >1.4, use Bundler instead of gem install ... !

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM