Project

General

Profile

Actions

Feature #4796

closed

Rails 3 support

Added by Eric Davis almost 15 years ago. Updated over 12 years ago.

Status:
Closed
Priority:
Low
Category:
Rails support
Target version:
Start date:
2010-02-10
Due date:
% Done:

100%

Estimated time:
Resolution:
Fixed

Description

Migrate Redmine to Rails 3 once Rails is out of beta. Must make sure Redmine plugins are still functional and can be ported easily from Rails 2.x.


Files

response_time.png (5.76 KB) response_time.png Jean-Philippe Lang, 2012-03-02 20:46

Related issues

Related to Redmine - Defect #8421: REST API may produce invalid jsonClosed2011-05-21

Actions
Related to Redmine - Feature #4005: Setup shoulda to make it easier to testClosedEric Davis2009-10-08

Actions
Related to Redmine - Defect #8989: r6351 causes unexpected chars to be displayed in calendarClosedToshi MARUYAMA2011-08-05

Actions
Related to Redmine - Defect #8751: Email notification: bug, when number of recipients more then 8Closed2011-07-06

Actions
Related to Redmine - Patch #6317: Template names conventionsClosedToshi MARUYAMA2010-09-07

Actions
Related to Redmine - Defect #9252: Regression: application title escaped 2 timesClosedToshi MARUYAMA2011-09-15

Actions
Related to Redmine - Feature #9759: HTML minification and compressionNew

Actions
Actions #2

Updated by Eric Davis about 14 years ago

  • Assignee deleted (Eric Davis)
Actions #3

Updated by Luiz Picanço almost 14 years ago

Any news about this ?

Actions #4

Updated by John Yani almost 14 years ago

1.2.0 will stick with 2.3.10 (#6887)

Maybe after 1.2.0 release something will be clearer. What is engines support BTW?

Actions #5

Updated by Eric Thomas almost 14 years ago

John Yani wrote:

1.2.0 will stick with 2.3.10 (#6887)

Maybe after 1.2.0 release something will be clearer. What is engines support BTW?

The next release of rails (3.1) will have engines support.

Actions #6

Updated by Felix Schäfer almost 14 years ago

Eric Thomas wrote:

The next release of rails (3.1) will have engines support.

Source/link? I fear they won't work exactly like the ones in 2.3 did, i.e. we still have to evaluate exactly what changes and how that affects us.

Actions #7

Updated by Jean-Baptiste Barth almost 14 years ago

Sources: rails-engines site, the blog of Piotr Sarnacki, and I've got some bookmarks about the transition at home.

What's sure for now:
  • Rails 3.0 supports a kind of Engines, but there's no mechanism for migrations, nor copying assets automatically (nor overriding views iirc) ; for sure they're not useable in Redmine at this point
  • Rails 3.1 Engines will support these kind of things (needs to be precised I know), but all documentation I read on Rails3' engines makes me think that plugin developers would have to package their plugin as a gem
  • Redmine cannot support Rails 2.3.x and Rails 3.x at the same time :)
Actions #8

Updated by Etienne Massip almost 14 years ago

Just a note about .xml format : Rails 3 does not include Builder anymore, it's now one of its dependencies.

Actions #9

Updated by Toshi MARUYAMA over 13 years ago

  • Category set to Rails support
Actions #10

Updated by Etienne Massip over 13 years ago

Jean-Baptiste Barth wrote:

  • Rails 3.0 supports a kind of Engines, but there's no mechanism for migrations, nor copying assets automatically (nor overriding views iirc) ; for sure they're not useable in Redmine at this point
  • Rails 3.1 Engines will support these kind of things (needs to be precised I know), but all documentation I read on Rails3' engines makes me think that plugin developers would have to package their plugin as a gem

Indeed, Rails 3.1 RC is out and supports migrations as well as moutable apps, see http://weblog.rubyonrails.org/2011/5/22/rails-3-1-release-candidate.

Notes- :

Rails 3 applications include a Gemfile and support the use of Bundler (see http://weblog.rubyonrails.org/2010/8/29/rails-3-0-it-s-done).
Rails 3.1 default scripting lib is now jQuery instead of Prototype.

Actions #11

Updated by Fabian Becker over 13 years ago

Is there any update on migrating to Rails 3.x? It's becoming a pain maintaining Redmine as it currently is. Upgrading to 3.0/3.1RC would definitely improve the development process.

I do understand that you are having trouble loosing compatibility to lots of good Redmine plugins, so I suggest you start Redmine + Rails 3.1RC development on a seperate branch and publish Redmine for both Rails versions in a transitional period (maybe 1 year?) giving all plugin developers time to migrate their plugins to a Rails Engine.

Any thoughts?

Actions #12

Updated by Etienne Massip over 13 years ago

  • Target version set to Candidate for next major release

Fabian Becker wrote:

It's becoming a pain maintaining Redmine as it currently is.

Can't see why ?

Actions #15

Updated by Etienne Massip over 13 years ago

You should try to make it work straight with Rails 3.1 (rc4 is the last release) since (I guess) Redmine will never run with 3.0 due to the lack of engine support.

Moreover, you might detect and report some Rails 3.1 rc issues whic could be fixed before release time, making it easier to integrate with RM.

BTW, do you run Rails 3 RM with Ruby 1.9 ?

Actions #17

Updated by Etienne Massip over 13 years ago

RoR team is organizing a hack fest for 3.1 : http://weblog.rubyonrails.org/2011/7/14/rails-3-1-hackfest

Actions #20

Updated by Toshi MARUYAMA over 13 years ago

http://mrjaba.posterous.com/ruby-news-roundup-06-04-2011

:rhtml and :rxml were finally removed as template handlers.

Actions #21

Updated by Etienne Massip over 13 years ago

Nice job on routes =)

Got some nice reading for you: http://www.h-online.com/open/features/From-Rails-2-3-to-3-0-1285884.html

Edit: permalink: http://h-online.com/-1285884

Actions #22

Updated by Luiz Picanço over 13 years ago

Interesting article !

Etienne Massip wrote:

Nice job on routes =)

Got some nice reading for you: http://www.h-online.com/open/features/From-Rails-2-3-to-3-0-1285884.html

Edit: permalink: http://h-online.com/-1285884

Actions #23

Updated by David Bennett about 13 years ago

If you need any direction, the Spree project has great 3.0 and 3.1 support: http://spreecommerce.com/blog

The "Extension" system they have is great as you just add a line in your Gemfile that points to a github project and vola! extra features :)

BDQ has also created Deface, A view editor that alters views based on css rules: https://github.com/railsdog/deface

Actions #25

Updated by Etienne Massip about 13 years ago

Another article from the H: http://h-online.com/-1285887

Actions #26

Updated by Alexandre de Oliveira about 13 years ago

So, is there any official announcement regarding 3.x support? A plan? Redmine 2.0? I found nothing on Wiki. Is there anyone leading the efforts to this end?

Because I'd like to contribute to make Redmine Rails 3.x compatible. It's not clear if there's a branch for it. I guess any patch regarding this shouldn't go to master branch, isn't it? It seems Toshi is already doing some work on this. How could I be of help regarding this matter?

Second, don't you agree this is not the correct place for posting about these Rails 3.1's new features articles, like Etienne's?

Thank you.

Actions #27

Updated by Toshi MARUYAMA about 13 years ago

  • % Done changed from 0 to 40

I rebased on r7627.

Git: Mercurial:

If you run with current database of Redmine 1.2 on Rails 2.3.11,
you need to run "rake db:migrate".

In order to run tests,
you need to install object_daddy for Rails 3.1.

ruby script/rails plugin install git://github.com/awebneck/object_daddy.git

The revisions are from following repositories.

Git and Mercurial revisions are synchronized by hg-git .
If you want to improve it, you can choose what you like.

Actions #28

Updated by David Bennett about 13 years ago

As this is now Rails 3.1... and a lot of things will break in the upgrade anyway.

Would it be a good idea to change this to a mountable engine?
(or even a stranded engine so that users can upgrade by just changing the version in the Gemfile.)

I have experience and can help out if you go down this path.

CON: You may want to namespace everything so it plays nice with other mountable engines.

Actions #29

Updated by Felix Schäfer about 13 years ago

David, do you have experience with the 3.1 full engines?

Actions #30

Updated by David Bennett about 13 years ago

Felix Schäfer wrote:

David, do you have experience with the 3.1 full engines?

If by full engines you mean ones with there own logic/models/controllers/migrations that can be added by just adding something to your Gemfile.

Then yes, I use them where ever possible :)

Though I don't have all that much experience with mountable ones yet.. as 3.1 is still new and I don't really have any bread-n-butter projects in my day job that could use the functionality.

Actions #31

Updated by Felix Schäfer about 13 years ago

David Bennett wrote:

Felix Schäfer wrote:

David, do you have experience with the 3.1 full engines?

If by full engines you mean ones with there own logic/models/controllers/migrations that can be added by just adding something to your Gemfile.

Then yes, I use them where ever possible :)

Though I don't have all that much experience with mountable ones yet.. as 3.1 is still new and I don't really have any bread-n-butter projects in my day job that could use the functionality.

No, that's full engines vs. mountable apps. Mountable apps are self-contained and referenced only in the parent routes.rb to tell which "top-level" URI the mountable app has. Full engines are "nearer" to the 2.3 engines in that they are loaded with the main app, have access to all the same models, controllers, and everything (mountable apps are fully segregated). Both types are/can be packaged as gems though.

Actions #34

Updated by Toshi MARUYAMA almost 13 years ago

  • % Done changed from 40 to 50

I rebased on r8089.

Git: Mercurial:

Changes

  • rename css to css.erb
  • use asset_path instead of hard-coded path
diff --git a/app/assets/stylesheets/scm.css.erb b/app/assets/stylesheets/scm.css.erb
--- a/app/assets/stylesheets/scm.css.erb
+++ b/app/assets/stylesheets/scm.css.erb
@@ -9,7 +9,7 @@

 li.change {
     list-style-type:none;
-    background-image: url(../images/bullet_black.png);
+    background-image: url(<%= asset_path "bullet_black.png" %>); 
     background-position: 1px 1px;
     background-repeat: no-repeat;
     padding-top: 1px;

Revisions are from following repository.
Actions #38

Updated by John Yani almost 13 years ago

Rails 3.2.0 is out

Is there any work break down structure of work required to complete porting Redmine to Rails 3? Are there any routine tasks that unexperienced programmer could help with?

Actions #40

Updated by Sridhar P over 12 years ago

I would like to work on this. I am thinking in the lines of forking on github and submitting pull requests whenever I have completed a significant task. Talking of tasks, is there any list of issues/to-do's that I can work on?

Actions #41

Updated by John Yani over 12 years ago

Sridhar P wrote:

I would like to work on this. I am thinking in the lines of forking on github and submitting pull requests whenever I have completed a significant task. Talking of tasks, is there any list of issues/to-do's that I can work on?

I think you can start with cloning and setting up test environment to see what doesn't work. Then if you manually tested all features and everything seems to work, you can run redmine tests and see if there are any failures. I there are no any, you're done.

Then you can think of how to enable users to use Redmine with both Rails 2 and Rails 3. As of now the work is done/coordinated by Toshi. Seems like every week he rebases his work on the latest revision from svn trunk. AFAIK, there are no any todo lists. But you can look into git/hg log. There are many commits marked as "TODO", so you can review these patches to see what's wrong with them.

Actions #42

Updated by Jean-Philippe Lang over 12 years ago

I have a working copy that runs and passes the full tests suite with Rails 3.1. There's some work to be done in order to provide the current features for Redmine plugins (migrations, view overriding, assets...) but still, most plugins won't be compatible out of the box. And honestly, I'm a bit disappointed with the performance. Redmine is 1.5x to 2x slower than with Rails 2.3. With ruby 1.9.3, it barely runs as fast as current trunk with Rails 2.3 + ruby 1.8.7.

Then you can think of how to enable users to use Redmine with both Rails 2 and Rails 3.

That's not really an option. There are too many changes in Rails 3 to support both versions with the same code base.

Actions #43

Updated by Jean-Philippe Lang over 12 years ago

Here are the results of my quick performance tests (Rails 2.3 vs. Rails 3.2):

Actions #44

Updated by Toshi MARUYAMA over 12 years ago

Jean-Philippe Lang wrote:

I have a working copy that runs and passes the full tests suite with Rails 3.1.

Could you create branch and commit to it such as source:sandbox/rails-2.3 ?

Actions #45

Updated by John Yani over 12 years ago

Did anybody find out how to get wiki working? I've got an error:

can't write unknown attribute `versioned_type'
activerecord (3.2.1) lib/active_record/attribute_methods/write.rb:34:in `write_attribute'
activerecord (3.2.1) lib/active_record/attribute_methods/dirty.rb:67:in `write_attribute'
activerecord (3.2.1) lib/active_record/attribute_methods.rb:31:in `[]='
vendor/plugins/acts_as_versioned/lib/acts_as_versioned.rb:383:in `clone_versioned_model'
vendor/plugins/acts_as_versioned/lib/acts_as_versioned.rb:303:in `save_version_on_create'
app/controllers/wiki_controller.rb:154:in `update'

the problem is in the following line:

vendor/plugins/acts_as_versioned/lib/acts_as_versioned.rb
194: self.versioned_inheritance_column = options[:inheritance_column] || "versioned_#{inheritance_column}"

Somehow versioned_type column is missing.

Actions #46

Updated by John Yani over 12 years ago

Update:

Seems like it is because Redmine doesn't use rake tasks provided by acts_as_versioned: create_versioned_table and drop_versioned_table

So, I should add migration field for versioned_type myself

Actions #47

Updated by John Yani over 12 years ago

Here is a patch to enable wiki editing in Rails 3.2.1 https://github.com/marutosi/redmine/pull/6

Actions #48

Updated by Jean-Philippe Lang over 12 years ago

  • Target version changed from Candidate for next major release to 2.0.0
Actions #49

Updated by Terence Mill over 12 years ago

Can u explain ur results? For the first look rails 2.3 and ruby 1.9.3 performns best, and not the newest stack with rails 3.

Jean-Philippe Lang wrote:

Here are the results of my quick performance tests (Rails 2.3 vs. Rails 3.2):

Actions #50

Updated by Jean-Philippe Lang over 12 years ago

Terence Mill wrote:

Can u explain ur results? For the first look rails 2.3 and ruby 1.9.3 performns best, and not the newest stack with rails 3.

Indeed, Rails 2.3 performs best as mentionned above. The graph shows the average response times in seconds for a few actions (assets are not involved here). Not much more to explain...

Actions #51

Updated by John Yani over 12 years ago

Terence Mill wrote:

Can u explain ur results? For the first look rails 2.3 and ruby 1.9.3 performns best, and not the newest stack with rails 3.

Here is the detailed explanation:
http://bibwild.wordpress.com/2011/07/12/more-thoughts-on-unbearably-slow-rails3/
Shortly, it is because of extra ruby garbage collection, caused by increased size of the call stack in Rails 3.

Actions #52

Updated by Alex Shulgin over 12 years ago

Hello good sirs.

Any chance of getting this done finally, especially in light of this (rails 2.3 no longer receives security updates from the core team): https://groups.google.com/d/msg/rubyonrails-talk/ZzL90ec7iAQ/368GA-TeQ6AJ ?

--
Regards,
Alex

Actions #53

Updated by Jean-Philippe Lang over 12 years ago

The upgrade to Rails 3.0 is planned for Redmine 2.0 that should be the next major release.

Actions #54

Updated by Terence Mill over 12 years ago

Really waiting for this Release, especially Prototype.js has been replaced with jQuery for ajax calls.

Actions #55

Updated by Toshi MARUYAMA over 12 years ago

Terence Mill wrote:

Really waiting for this Release, especially Prototype.js has been replaced with jQuery for ajax calls.

"prototype-rails" and "prototype_legacy_helper" provide compatibility.

Actions #56

Updated by Etienne Massip over 12 years ago

Terence Mill wrote:

Really waiting for this Release, especially Prototype.js has been replaced with jQuery for ajax calls.

What difference does this make?

Actions #57

Updated by Onno van der Straaten over 12 years ago

Etienne Massip wrote:

Terence Mill wrote:

Really waiting for this Release, especially Prototype.js has been replaced with jQuery for ajax calls.

What difference does this make?

This is also one of the things I would like to see in Redmine 2.0. Upgrading to Rails 3 however does not imply that Redmine 2.0 will use JQuery. I personally doubt that this effort is also about migrating to JQuery.

If you are using Redmine as is it doesn't matter what framework is being used. But if you want to extend Redmine, it does. So for example I added functionality which uses a JQuery Slides (http://slidesjs.com/). Now my 'extended' Redmine installation uses JQuery and not Prototype for some pages. Using Prototype and JQuery in one website is of course not so nice but necessary because JQuery has a lot more to offer.

Actions #58

Updated by Etienne Massip over 12 years ago

Onno van der Straaten wrote:

Using Prototype and JQuery in one website is of course not so nice but necessary because JQuery has a lot more to offer.

Whatever, Redmine has not Javascript API, jQuery and Prototype can coexist very well and I can't see why using 2 tooling frameworks would be bad.

Actions #59

Updated by Terence Mill over 12 years ago

Hmm i hoped we will get rid of prototype because we wanna integrate our SSo Solution for redmine (which is based on CAS) and the problem with redirect on ajax request direct after an revelidation attempt of the SSO gatway (a java servlet filter in front of web.xml war of a jruby redmine tomcat installation), this redirect of an XMLHttpRequest (fired by prototyp.js i think) is not understood by the browser. This leads to "nothing happening" in the application as long a non ajax request is triggered by the request caused by user click.
Our SSO Gateway in front of the redmine can understand jquery ajax requests and wraps them so that the redirect in the browser works. This does not work for prototype js.

There is no documentation where and how often ajax is used in redmine forms, else we could think about moving this urls by filter out of the sso secure area and workawound the problem.

Etienne Massip wrote:

Terence Mill wrote:

Really waiting for this Release, especially Prototype.js has been replaced with jQuery for ajax calls.

What difference does this make?

Actions #60

Updated by Etienne Massip over 12 years ago

Terence Mill wrote:

Our SSO Gateway in front of the redmine can understand jquery ajax requests and wraps them so that the redirect in the browser works. This does not work for prototype js.

What is done with jQuery making the Ajax request understood that you can't do with Prototype?

Actions #61

Updated by Jean-Philippe Lang over 12 years ago

  • Status changed from New to Closed
  • Assignee set to Jean-Philippe Lang
  • % Done changed from 70 to 100
  • Resolution set to Fixed

Please open a new ticket for any issue related to Rails3 support.

Actions

Also available in: Atom PDF