Errors updating from 0.8.3 to trunk

Added by Vladimir L about 8 years ago

First off, I've been using redmine for the better part of a year and it's been great! A big thanks to the developers is in order :)

I've been having an error with migrating my database version to trunk. Having checked out trunk revision 2982, copied over database.yml and email.yml as suggested, I ran

rake db:migrate:upgrade_plugin_migrations RAILS_ENV="production"

to get the following message:

Object is not missing constant Project!

The full trace is attached below:

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

I'm running ruby-1.8.7 with PostgreSQL 8.4. The log for postgresql doesn't yield anything unexpected:

LOG:  statement: SHOW client_min_messages
LOG:  statement: SET client_min_messages TO 'panic'
LOG:  statement: SHOW standard_conforming_strings
LOG:  statement: SET client_min_messages TO 'notice'
LOG:  statement: SELECT version()
LOG:  statement: SET client_encoding TO 'utf8'
LOG:  statement: SELECT 1
LOG:  unexpected EOF on client connection

Thanks in advance for your help,
Vlad

Replies (14)

RE: Errors updating from 0.8.3 to trunk - Added by Vladimir L about 8 years ago

This has been resolved - apparently RAILS_ENV=production needed to go in front of the commands rather than after them. I'll update the instructions on the wiki so that nobody else falls for such a simple problem.

Thanks :)
Vlad

RE: Errors updating from 0.8.3 to trunk - Added by Little Pug about 8 years ago

Hello

I have a similar problem with upgrading from 0.84 to trunk (r2982).
I checked out trunk, copied database.yml and email.yml and the files to the new redmine directory.

When I tried to run rake db:migrate the first time it said it requires a key
I fixed this by running "rake config/initializers/session_store.rb".

Now when I run:

 rake db:migrate RAILS_ENV="production"

I get the following:

rake aborted!
Object is not missing constant Project!

Any Ideas?

RE: Errors updating from 0.8.3 to trunk - Added by Vladimir L about 8 years ago

Sorry, I wasn't clear enough when I was "... apparently RAILS_ENV=production needed to go in front of the commands rather than after them..."

Try running

RAILS_ENV=production rake db:migrate

:)

RE: Errors updating from 0.8.3 to trunk - Added by Ahmed A almost 8 years ago

I am seeing this problem also, using Redmine 0.9 and PostgreSQL 8.3.9 on Fedora Linux 11 (Leonidas). I have done what you suggested above, and it still gives me the error.

Any more suggestions?

RE: Errors updating from 0.8.3 to trunk - Added by Ahmed A almost 8 years ago

To anyone else who sees this error ("Object is not missing constant Project") on Fedora Linux 11, or perhaps other distros as well:

After I removed everything, I reinstalled PostgreSQL.

Then I installed everything required for Ruby, Rails, and so on USING "yum" NOT "gem". The only time I used "gem" to download gems and so on was simply to update gem itself (gem update --system).

It worked. I can only assume that there is a version/installation incompatibility going on that I am not aware of, so by using yum to update the system with slightly older versions of the different dependencies (Rails, actionmailer, activerecord, and so on)... it worked.

good luck.

RE: Errors updating from 0.8.3 to trunk - Added by Otaci Martins almost 8 years ago

Same problem with me when trying upgrade from 0.8.7 to 0.9.

My specs:

SO:

Fedora 11
Kernel 2.6.30.9-96.fc11.i586

Dababase:

postgresql-8.3.8-2.fc11.i586

Ruby/Rails:

ruby-irb-1.8.6.383-4.fc11.i586
rubygem-rake-0.8.7-1.fc11.noarch
rubygem-activeresource-2.3.2-2.fc11.noarch
ruby-1.8.6.383-4.fc11.i586
ruby-rdoc-1.8.6.383-4.fc11.i586
ruby-postgres-0.7.1-11.fc11.i586
rubygem-activesupport-2.3.2-2.fc11.noarch
rubygem-actionmailer-2.3.2-3.fc11.noarch
rubygem-activerecord-2.3.2-2.fc11.noarch
rubygem-rails-2.3.2-5.fc11.noarch
ruby-libs-1.8.6.383-4.fc11.i586
rubygems-1.3.1-2.fc11.noarch
rubygem-actionpack-2.3.2-2.fc11.noarch
rubygem-rack-1.0.0-1.fc11.noarch

  • LOCAL GEMS ***

actionmailer (2.3.2)
actionpack (2.3.2)
activerecord (2.3.5, 2.3.2)
activeresource (2.3.2)
activesupport (2.3.5, 2.3.2)
rack (1.0.1, 1.0.0)
rails (2.3.2)
rake (0.8.7)

Although my environment is very close to Anmed's one, isn't acceptable to me uninstall/reinstall all packages.

So i don't ruby, i'm not a developer, i'm just a system admin trying to use Redmine (excelent, thanks to developers). I will keep an eye in this thread.

RE: Errors updating from 0.8.3 to trunk - Added by Otaci Martins almost 8 years ago

Otaci Martins wrote:

Same problem with me when trying upgrade from 0.8.7 to 0.9.

My specs:

SO:

Fedora 11
Kernel 2.6.30.9-96.fc11.i586

Dababase:

postgresql-8.3.8-2.fc11.i586

Ruby/Rails:

ruby-irb-1.8.6.383-4.fc11.i586
rubygem-rake-0.8.7-1.fc11.noarch
rubygem-activeresource-2.3.2-2.fc11.noarch
ruby-1.8.6.383-4.fc11.i586
ruby-rdoc-1.8.6.383-4.fc11.i586
ruby-postgres-0.7.1-11.fc11.i586
rubygem-activesupport-2.3.2-2.fc11.noarch
rubygem-actionmailer-2.3.2-3.fc11.noarch
rubygem-activerecord-2.3.2-2.fc11.noarch
rubygem-rails-2.3.2-5.fc11.noarch
ruby-libs-1.8.6.383-4.fc11.i586
rubygems-1.3.1-2.fc11.noarch
rubygem-actionpack-2.3.2-2.fc11.noarch
rubygem-rack-1.0.0-1.fc11.noarch

  • LOCAL GEMS ***

actionmailer (2.3.2)
actionpack (2.3.2)
activerecord (2.3.5, 2.3.2)
activeresource (2.3.2)
activesupport (2.3.5, 2.3.2)
rack (1.0.1, 1.0.0)
rails (2.3.2)
rake (0.8.7)

Although my environment is very close to Anmed's one, isn't acceptable to me uninstall/reinstall all packages.

So i don't ruby, i'm not a developer, i'm just a system admin trying to use Redmine (excelent, thanks to developers). I will keep an eye in this thread.

Updated:

  • LOCAL GEMS ***

actionmailer (2.3.5, 2.3.2)
actionpack (2.3.5, 2.3.2)
activerecord (2.3.5, 2.3.2)
activeresource (2.3.5, 2.3.2)
activesupport (2.3.5, 2.3.2)
rack (1.0.1, 1.0.0)
rails (2.3.5, 2.3.2)
rake (0.8.7)

RE: Errors updating from 0.8.3 to trunk - Added by Ahmed A almost 8 years ago

Installed Redmine again on a different machine (yes, it's very popular...), and ran into SAME problems. Finally got it to work after simply making sure I was running Rails 2.3.2 - I could not get it to work with 2.3.5 or 2.3.4. That's all it was. It's not enough to install Rails 2.3.2 however; you have to configure the file <root>/config/environment.rb to reflect that you want 2.3.2:

RAILS_GEM_VERSION = '2.3.2' unless defined? RAILS_GEM_VERSION

If there is a problem with running 0.9-stable with Rails 2.3.2, then that's not going to be good. But I checked with my successful installation that's been running for the last month, and sure enough it was 2.3.2.

Good luck.

--- Summary of environment via "gem list"

  • LOCAL GEMS ***

actionmailer (2.3.5, 2.3.4, 2.3.2)
actionpack (2.3.5, 2.3.4, 2.3.2)
activerecord (2.3.5, 2.3.4, 2.3.2)
activeresource (2.3.5, 2.3.4, 2.3.2)
activesupport (2.3.5, 2.3.4, 2.3.2)
cgi_multipart_eof_fix (2.5.0)
daemons (1.0.10)
fastthread (1.0.7)
gem_plugin (0.2.3)
mongrel (1.1.5)
mongrel_cluster (1.0.5)
rack (1.1.0, 1.0.1, 1.0.0)
rails (2.3.5, 2.3.4, 2.3.2)
rake (0.8.7)

RE: Errors updating from 0.8.3 to trunk - Added by Ahmed A almost 8 years ago

Oh just in case you don't know how to install a particular gem:

$ gem install rails --version 2.3.2

That will install rails and all of its dependencies...

RE: Errors updating from 0.8.3 to trunk - Added by Otaci Martins almost 8 years ago

No luck with rails 2.3.2 as posted by Ahmed.

Now i'll try a complete new virtual machine with minimal CentOS 5.3 building all ruby stuff from source.

I'll post the results later.

RE: Errors updating from 0.8.3 to trunk - Added by Otaci Martins almost 8 years ago

Same error using CentOS 5.3 and Ruby stuff compiled from scratch:

[root@vm04 redmine-0.9.0]# RAILS_ENV=production rake db:migrate
(in /opt/redmine/redmine-0.9.0)
rake aborted!
Object is not missing constant Project!

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

I've tried with rails 2.3.5 as redmine-0.9.0 requires and also with rails 2.3.2 as Ahmed suggested above.

  • LOCAL GEMS ***

actionmailer (2.3.5, 2.3.2)
actionpack (2.3.5, 2.3.2)
activerecord (2.3.5, 2.3.2)
activeresource (2.3.5, 2.3.2)
activesupport (2.3.5, 2.3.2)
postgres-pr (0.6.1)
rack (1.0.1)
rails (2.3.5, 2.3.2)
rake (0.8.7)
rubygems-update (1.3.5)

RE: Errors updating from 0.8.3 to trunk - Added by Otaci Martins almost 8 years ago

Tried with MySQL and it WORKS !

So, perhaps the problem relates to postgresql gem (postgres-pr).

Unfortunatelly we can't go with redmine in production because we prefer PostgreSQL, but at least we can try 0.9.0 in labs until there is a solution.

Specs:

- CentOS 5.3
- ruby 1.8.7 (2009-04-08 patchlevel 160) [i686-linux]
- rails 2.3.5
- mysql 5.0.77

  • LOCAL GEMS ***

actionmailer (2.3.5, 2.3.2)
actionpack (2.3.5, 2.3.2)
activerecord (2.3.5, 2.3.2)
activeresource (2.3.5, 2.3.2)
activesupport (2.3.5, 2.3.2)
mysql (2.8.1)
postgres-pr (0.6.1)
rack (1.0.1)
rails (2.3.5, 2.3.2)
rake (0.8.7)
rubygems-update (1.3.5)

RE: Errors updating from 0.8.3 to trunk - Added by Ahmed A almost 8 years ago

I do remember the first time doing the installation, I spent a significant amount of time trying to get the gem postgres-pr to work ... I cannot remember the symptoms but there was indeed something wrong. So I removed it from the first machine, and instead used yum to install the Ruby-Postgres package.

$ yum install ruby-postgres*

If you'll notice, in my gem listing, I do not have postgres-pr installed - neither in the old installation nor the new one. Both are working fine with postgres.

Hope it works for you.

RE: Errors updating from 0.8.3 to trunk - Added by Otaci Martins almost 8 years ago

SUCCESS !!!

Thanks to the Ahmed's tip, but the solution is a bit different.

Code:

# yum install postgresql-devel
# gem uninstall postgres-pr
# gem install postgres

It rocks. Now RAILS_ENV=production rake db:migrate works like a charm.

Gem list:
actionmailer (2.3.5, 2.3.2)
actionpack (2.3.5, 2.3.2)
activerecord (2.3.5, 2.3.2)
activeresource (2.3.5, 2.3.2)
activesupport (2.3.5, 2.3.2)
postgres (0.7.9.2008.01.28)
rack (1.0.1)
rails (2.3.5, 2.3.2)
rake (0.8.7)
rubygems-update (1.3.5)

(1-14/14)