ChiliProject is not maintained anymore. Please be advised that there will be no more updates.

We do not recommend that you setup new ChiliProject instances and we urge all existing users to migrate their data to a maintained system, e.g. Redmine. We will provide a migration script later. In the meantime, you can use the instructions by Christian Daehn.

Chiliproject upgrade problems 2.3.0 -> 2.5.0

Added by Wiki Bit at 2011-12-07 12:29 pm

Hi,

again, running into the quite unstable install/upgrade process :

following the instructions at https://www.chiliproject.org/projects/chiliproject/wiki/Upgrade do not work

to start : some info on my setup :
- ubuntu 11.04
- chiliproject + mysql + Ruby 1.9.1
- using git to upgrade chiliproject

a fairly straight forward installation

to upgrade, I started as prescribed (in the chiliproject directory):
$ sudo git fetch origin
$ sudo git checkout v2.5.0
$ sudo bundle install
$ sudo rake generate_session_store
$ sudo rake db:migrate RAILS_ENV=production

here it goes wrong :

!!! 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

Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)

a look on google : apparently this a very common issue, thousands of users have this issue

most of the suggested fixes come down to (re)installing the mysql gem, so I tried (each time followed by a bundle install) :

$ sudo gem uninstall mysql
$ sudo gem install mysql
*did not work

$ sudo gem uninstall mysql
$ sudo gem install mysql -- --with-mysql-include=/usr/include/mysql --with-mysql-lib=/usr/lib/mysql --with-mysql-config=/usr/bin/mysql_config
*did not work

$ sudo gem uninstall mysql
$ sudo env ARCHFLAGS="-arch i386 arch x86_64" gem install mysql - --with-mysql-include=/usr/include/mysql --with-mysql-lib=/usr/lib/mysql --with-mysql-config=/usr/bin/mysql_config
*did not work

So, I copied the old mysql.rb :
$ sudo cp usr/local/lib/ruby/gems/1.9.1/gems/mysql-2.8.1/lib/mysql.rb /opt/chiliproject/lib/
then
$ sudo rake db:migrate RAILS_ENV=production
now gives a new error

rake aborted!
uninitialized constant MysqlCompat::MysqlRes

Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)

again onto google : seems to be occuring a lot, however, again, the suggested fixes do not work:
- (re)installing the mysql gem, followed by a bundle install
- installing the mysql 2.7 gem (as suggested on a few boards) does not work either :

sudo env ARCHFLAGS="-arch i386 -arch x86_64"  gem install mysql -v=2.7 --no-rdoc --no-ri  -- --with-mysql-include=/usr/include/mysql --with-mysql-lib=/usr/lib/mysql --with-mysql-config=/usr/bin/mysql_config
Building native extensions.  This could take a while...
ERROR:  Error installing mysql:
    ERROR: Failed to build gem native extension.

        /usr/local/bin/ruby extconf.rb --with-mysql-include=/usr/include/mysql --with-mysql-lib=/usr/lib/mysql --with-mysql-config=/usr/bin/mysql_config
checking for mysql_ssl_set()... yes
checking for mysql.h... yes
creating Makefile

make
gcc -I. -I/usr/local/include/ruby-1.9.1/i686-linux -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -DHAVE_MYSQL_SSL_SET -DHAVE_MYSQL_H  -D_FILE_OFFSET_BITS=64  -I/usr/include/mysql  -DBIG_JOINS=1  -fno-strict-aliasing   -DUNIV_LINUX -DUNIV_LINUX -fPIC -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long  -o mysql.o -c mysql.c
mysql.c:6:21: fatal error: version.h: No such file or directory
compilation terminated.
make: *** [mysql.o] Error 1

Gem files will remain installed in /usr/local/lib/ruby/gems/1.9.1/gems/mysql-2.7 for inspection.
Results logged to /usr/local/lib/ruby/gems/1.9.1/gems/mysql-2.7/./gem_make.out

(I also tried without "--with-mysql-include=/usr/include/mysql --with-mysql-lib=/usr/lib/mysql --with-mysql-config=/usr/bin/mysql_config", same result)

also is mentioned to install the correct liblclient for mysql, however, that had to be done for the initial install, and it is still installed :

$ sudo apt-get install libmysqlclient15-dev 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'libmysqlclient-dev' instead of 'libmysqlclient15-dev'
libmysqlclient-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 24 not upgraded.

Additional info :

gem list
  • LOCAL GEMS ***

actionmailer (2.3.14)
actionpack (2.3.14)
activerecord (2.3.14)
activeresource (2.3.14)
activesupport (2.3.14)
bundler (1.0.21)
coderay (0.9.8)
daemon_controller (0.2.6)
daemons (1.1.4)
eventmachine (0.12.10)
fastthread (1.0.7)
i18n (0.4.2)
markup (0.1.3)
minitest (1.6.0)
mysql (2.8.1)
mysql2 (0.3.11, 0.2.13)
net-ldap (0.2.2)
passenger (3.0.9)
rack (1.1.2)
rails (2.3.14)
rake (0.9.2, 0.8.7)
rdiscount (1.6.8)
rdoc (3.9.4, 2.5.8)
ruby-openid (2.1.8)
rubytree (0.5.3)
SimpleTrace (0.0.1)
thin (1.2.11)
usage (0.0.4)

chiliproject$ sudo bundle list
Gems included by the bundle: * actionmailer (2.3.14) * actionpack (2.3.14) * activerecord (2.3.14) * activeresource (2.3.14) * activesupport (2.3.14) * bundler (1.0.21) * coderay (0.9.8) * i18n (0.4.2) * mysql2 (0.2.13) * net-ldap (0.2.2) * rack (1.1.2) * rails (2.3.14) * rake (0.9.2) * rdoc (3.9.4) * ruby-openid (2.1.8) * rubytree (0.5.3)

$ sudo bundle check
The Gemfile's dependencies are satisfied

So, I end up with a broken Chiliproject install, and out of ideas after 3 days... upgrading should not be this hard

thanks

WB


Replies (2)

RE: Chiliproject upgrade problems 2.3.0 -> 2.5.0 - Added by Holger Just at 2011-12-07 12:49 pm

Hey there,

thanks for your rather details error description. The cause is rather simple though. Since ChiliProject 2.4, we don't support the mysql adapter for Ruby 1.9 anymore. This is not a restriction of us but instead of the mysql gem which doesn't properly work with the enforced string encodings in Ruby 1.9. Instead, please use the mysql2 adapter. It has its own bundler group and you seem to have it already installed. However, you need to adapt your database.yml, as mysql2 uses the string "mysql2" as the adapter, instead of just mysql.

Sorry if that wasn't clear. Sadly, the error message rails produces on a missing or misconfigured database adapter is rather misleading too.

RE: Chiliproject upgrade problems 2.3.0 -> 2.5.0 - Added by Wiki Bit at 2011-12-07 01:24 pm

hi,

thanks, I'm a few steps further already

you may want to add this as an important remark with the upgrade process, that would have saved lots of time & pain.

one other remark though

when I continue the upgrade steps, I get the error :

$ sudo rake db:migrate RAILS_ENV=production 
rake aborted!
You have already activated rake 0.9.2.2, but your Gemfile requires rake 0.9.2. Using bundle exec may solve this.

(See full trace by running task with --trace)

so I did run all the commands with "bundle exec"

sudo bundle exec rake db:migrate:plugins RAILS_ENV=production

that seems to work without error messages

I assume this will not be an issue for chiliproject itself??

At first sight, my chiliproject setup is back up and running

Thanks

WB

(1-2/2)