Project

General

Profile

Cannot run Redmine 2.0.3 after upgrade from 1.4.x

Added by Adrian P over 12 years ago

Upgrading Redmine is always a pain in the a**. I postpone it until i need to do plugins work so that i avoid the headache.

Today, i did that again. I run Redmine with Pissenger and i get the stupid error:
Please install the mysql2 adapter: `gem install activerecord-mysql2-adapter` (mysql2 is not part of the bundle. Add it to Gemfile.)

even if activerecord-msyql2-... is installed.

I upgraded everything: ruby, rails, rubygem.

Rails 3.2.6
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
activerecord-mysql2-adapter (0.0.3)

I play by the book so what's wrong? Why do I get the error?

I put mysql2 in the configuration because without it i get a spawn error in the Pissenger that is even more abstract.

Exception NameError in application (wrong constant name RedmineApp) (process 2382, thread #<Thread:0x2b336af00370>):


Replies (6)

RE: Cannot run Redmine 2.0.3 after upgrade from 1.4.x - Added by William Roush over 12 years ago

Adrian P wrote:

Pissenger

Heh, it can feel like that sometimes.

(mysql2 is not part of the bundle. Add it to Gemfile.)

Did you run a "bundle install" again to pull the new gems?

Can you also please tell me you're running rvm so I can continue to hate it due to it overcomplicating people's Linux boxes that run one Ruby environment: Redmine.

I put mysql2 in the configuration because without it i get a spawn error in the Pissenger that is even more abstract.

mysql adapter was removed IIRC.

Can you print the output of this:

bundle show
gem list
script/about

RE: Cannot run Redmine 2.0.3 after upgrade from 1.4.x - Added by Adrian P over 12 years ago

Sure. I ran Centos with cPanel, never used RVM. For the future server, i will make a dedicated Centos image for the monster of ruby+rails+redmine implementation to avoid any interference.

I did the bundle install and i get:
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

For script/about i get an error, is that the full command?

O also need to confess a little sin: i commented pg, sqlite and rmagick in Gemfile but i can bet that it is not the reason of my headache.

Here it is for the rest

===bundle show===========
Gems included by the bundle: * actionmailer (3.2.6) * actionpack (3.2.6) * activemodel (3.2.6) * activerecord (3.2.6) * activeresource (3.2.6) * activesupport (3.2.6) * arel (3.0.2) * builder (3.0.0) * bundler (1.1.3) * coderay (1.0.7) * erubis (2.7.0) * fastercsv (1.5.5) * hike (1.2.1) * i18n (0.6.0) * journey (1.0.4) * jquery-rails (2.0.2) * json (1.7.4) * mail (2.4.4) * mime-types (1.19) * multi_json (1.3.6) * mysql (2.8.1) * net-ldap (0.3.1) * polyglot (0.3.3) * rack (1.4.1) * rack-cache (1.2) * rack-openid (1.3.1) * rack-ssl (1.3.2) * rack-test (0.6.1) * rails (3.2.6) * railties (3.2.6) * rake (0.9.2.2) * rdoc (3.12) * ruby-openid (2.1.8) * sprockets (2.1.3) * thor (0.15.4) * tilt (1.3.3) * treetop (1.4.10) * tzinfo (0.3.33)

=====gem list====

  • LOCAL GEMS ***

activerecord-mysql2-adapter (0.0.3)
bigdecimal (1.1.0)
io-console (0.3)
json (1.5.4)
minitest (2.5.1)
mysql2 (0.3.11)
rake (0.9.2.2)
rdoc (3.9.4)
rubygems-update (1.8.24)

RE: Cannot run Redmine 2.0.3 after upgrade from 1.4.x - Added by William Roush over 12 years ago

Adrian P wrote:

For script/about i get an error, is that the full command?

Yeah, that's fine, probably Ruby puking.

Your bundle list however is not, here is a proper 2.0.3 bundle:

root@roush-server:/tank/system/redmine_dev# bundle show
Gems included by the bundle:
  * actionmailer (3.2.6)
  * actionpack (3.2.6)
  * activemodel (3.2.6)
  * activerecord (3.2.6)
  * activeresource (3.2.6)
  * activesupport (3.2.6)
  * arel (3.0.2)
  * builder (3.0.0)
  * bundler (1.1.3)
  * coderay (1.0.6)
  * erubis (2.7.0)
  * hike (1.2.1)
  * i18n (0.6.0)
  * journey (1.0.4)
  * jquery-rails (2.0.2)
  * json (1.7.3)
  * mail (2.4.4)
  * metaclass (0.0.1)
  * mime-types (1.19)
  * mocha (0.12.1)
  * multi_json (1.3.6)
  * mysql2 (0.3.11)
  * net-ldap (0.3.1)
  * pg (0.13.2)
  * polyglot (0.3.3)
  * rack (1.4.1)
  * rack-cache (1.2)
  * rack-openid (1.3.1)
  * rack-ssl (1.3.2)
  * rack-test (0.6.1)
  * rails (3.2.6)
  * railties (3.2.6)
  * rake (0.9.2.2)
  * rdoc (3.12)
  * rmagick (2.13.1)
  * ruby-openid (2.1.8)
  * shoulda (2.11.3)
  * sprockets (2.1.3)
  * sqlite3 (1.3.6)
  * test-unit (2.5.1)
  * thor (0.15.4)
  * tilt (1.3.3)
  * treetop (1.4.10)
  * tzinfo (0.3.33)
  * yard (0.8.1)
root@roush-server:/tank/system/redmine_dev# script/about

Environment:
  Redmine version                          2.0.3.devel
  Ruby version                             1.9.2 (x86_64-linux)
  Rails version                            3.2.6
  Environment                              production
  Database adapter                         Mysql2
Redmine plugins:
  redmine_advanced_roadmap                 0.7.0
  redmine_inline_attach_screenshot         0.4.2
  version_details                          0.0.3
root@roush-server:/tank/system/redmine_dev# gem list

*** LOCAL GEMS ***

actionmailer (2.3.14, 2.3.5)
actionpack (2.3.14, 2.3.5)
activerecord (2.3.14, 2.3.5)
activeresource (2.3.14, 2.3.5)
activesupport (2.3.14, 2.3.5)
daemon_controller (1.0.0)
fastthread (1.0.7)
i18n (0.4.2)
passenger (3.0.12)
rack (1.1.3, 1.0.1)
rails (2.3.14, 2.3.5)
rake (0.9.2.2)

I'd remove the mysql2 gem, active-record-mysql2-adapter, confirm you have the GemFile from the 2.0.3 .tar.gz and re-run "gem install".

RE: Cannot run Redmine 2.0.3 after upgrade from 1.4.x - Added by Adrian P over 12 years ago

Indeed the bundler didn't run correctly. That was because /usr/bin/ruby was a different version of /usr/local/bin/ruby . I figured this out because it was omitting mri_19 even if ruby -v was saying 1.9

I reinstalled ruby & rails to be sure and did a correct symobolic link for /usr/bin/ruby

So, bundle run correctly now i ran into the problem that i had without mysql2. The Passenger says:

Exception class:
PhusionPassenger::ClassicRails::ApplicationSpawner::Error

and in error log i get this:
"wrong constant name RedmineApp"

RE: Cannot run Redmine 2.0.3 after upgrade from 1.4.x - Added by Adrian P over 12 years ago

I have now at script/about:

Redmine version                          2.0.3.devel.51635
Ruby version 1.9.3 (x86_64-linux)
Rails version 3.2.6
Environment production
Database adapter Mysql2

RE: Cannot run Redmine 2.0.3 after upgrade from 1.4.x - Added by Adrian P over 12 years ago

Well, i fixed it! 12 hours lost into the issue.

Finally, the last problem was my setup in apache config file in the "usrdata". I use Centos w cPanel.

You need to change the RailsBaseURI directive to RackBaseURI in your apache config file. RackBaseURI is the correct directive for Rails 3.

In my case:
DocumentRoot ................/public_html
RackBaseUri /

    (1-6/6)