Redmine with JRuby on PostgreSQL issue
Added by Vadim Kotov about 14 years ago
I've used redmine 0.9.1, 1.0 RC with PostgreSQL and it worked flawlessly on JRuby. However, when I've tried to upgrade Redmine to 1.0.3, and JRuby 1.5.5, there was an error in logs:
ActiveRecord::StatementInvalid (ActiveRecord::JDBCError: ERROR: column "issues.id" must appear in the GROUP BY clause or be used in an aggregate function Позиция: 78: SELECT COUNT(*) AS count_all, tracker_id AS tracker_id FROM (SELECT DISTINCT "issues".id FROM "issues" LEFT OUTER JOIN "projects" ON "projects".id = "issues".project_id LEFT OUTER JOIN "issue_statuses" ON "issue_statuses".id = "issues".status_id LEFT OUTER JOIN "trackers" ON "trackers".id = "issues".tracker_id WHERE (((projects.id = 2 OR (projects.lft > 7 AND projects.rgt < 10))) AND issue_statuses.is_closed='f') AND (((projects.status=1 AND projects.id IN (SELECT em.project_id FROM enabled_modules em WHERE em.name='issue_tracking')) AND (1=0 OR projects.is_public = 't' OR projects.id IN (6,4,3,1,2,5)))) GROUP BY tracker_id ) count_all_subquery): gems/gems/activerecord-jdbc-adapter-1.0.2-java/lib/arjdbc/jdbc/adapter.rb:178:in `execute' gems/gems/activerecord-jdbc-adapter-1.0.2-java/lib/arjdbc/jdbc/adapter.rb:267:in `select' gems/gems/activerecord-jdbc-adapter-1.0.2-java/lib/arjdbc/jdbc/adapter.rb:197:in `jdbc_select_all' app/controllers/projects_controller.rb:158:in `show' file:lib/jruby-rack-1.0.3.jar!/vendor/rack-1.2.1/rack/head.rb:9:in `call' file:lib/jruby-rack-1.0.3.jar!/vendor/rack-1.2.1/rack/methodoverride.rb:24:in `call' file:lib/jruby-rack-1.0.3.jar!/vendor/rack-1.2.1/rack/lock.rb:11:in `call' file:lib/jruby-rack-1.0.3.jar!/rack/adapter/rails.rb:36:in `serve_rails' file:lib/jruby-rack-1.0.3.jar!/rack/adapter/rails.rb:41:in `call' file:lib/jruby-rack-1.0.3.jar!/jruby/rack/rails.rb:180:in `call' file:lib/jruby-rack-1.0.3.jar!/rack/handler/servlet.rb:19:in `call' :1
To fix it, define a specific version of activerecord-jdbcpostgresql-adapter in warble.rb:
config.gems["activerecord-jdbcpostgresql-adapter"] = "0.9.7"
It doesn't work with version 1.0.2 of this adapter.
Hope this will help somebody, if he stuck with the same problem as I! It will be very useful, if somebody will state this fact in the wiki, for example here: HowTo_install_Redmine_in_Apache_Tomcat.
But I do not know whom to ask about this.
Replies (2)
RE: Redmine with JRuby on PostgreSQL issue - Added by Ben Siroshton over 13 years ago
I am also having this error. I tried adding the line to my warble.rb but it did not help. Could it be that a different version is still being used? If so how can I check/pervent that?
Thanks.
-=ben
RE: Redmine with JRuby on PostgreSQL issue - Added by Vadim Kotov over 13 years ago
I have a working configuration on Tomcat right now (Redmine 1.1.1, PostgreSQL 8.4, JRuby 1.5.6).
There are some lines from my warble.rb:
config.gems["rack"] = "1.0.1" config.gems["activerecord-jdbcpostgresql-adapter"] = "0.9.7" config.gems["jdbc-postgres"] = "8.4.702" config.gems["i18n"] = "0.4.2"
Full config avaliable at http://pastie.org/1803263
However, I forgot to mention that you need to install specific versions of ruby gems for all things to work. For example,
gem install activerecord-jdbcpostgresql-adapter -v=0.9.7to install required adapter v.0.9.7.
Did you install this? You can check all installed gems and their versions by running following command:
gem list
Hope this will help! Please update this thread when you'll finish.