Skip to content
This repository has been archived by the owner on Jul 24, 2021. It is now read-only.

Rails code does not run under ruby 1.9 #3981

Closed
openstreetmap-trac opened this issue Jul 23, 2021 · 8 comments
Closed

Rails code does not run under ruby 1.9 #3981

openstreetmap-trac opened this issue Jul 23, 2021 · 8 comments

Comments

@openstreetmap-trac
Copy link

Reporter: Zverik
[Submitted to the original trac issue database at 2.58am, Friday, 26th August 2011]

The following error occurs when doing rake db:migrate:

C:/Ruby192/rails/app/models/spam_observer.rb:6: syntax error, unexpected ':', expecting keyword_then or ',' or ';' or '\n'
    when record.is_a?(User): user = record
                            ^
C:/Ruby192/rails/app/models/spam_observer.rb:7: syntax error, unexpected keyword_when, expecting keyword_end
    when record.is_a?(DiaryEntry): user = record.user
        ^
C:/Ruby192/rails/app/models/spam_observer.rb:7: syntax error, unexpected ':', expecting keyword_end
    when record.is_a?(DiaryEntry): user = record.user
                                  ^
C:/Ruby192/rails/app/models/spam_observer.rb:8: syntax error, unexpected keyword_when, expecting keyword_end
    when record.is_a?(DiaryComment): user = record.user
        ^
C:/Ruby192/rails/app/models/spam_observer.rb:8: syntax error, unexpected ':', expecting keyword_end
    when record.is_a?(DiaryComment): user = record.user
                                    ^
C:/Ruby192/rails/app/models/spam_observer.rb:15: syntax error, unexpected keyword_end, expecting $end
@openstreetmap-trac
Copy link
Author

Author: TomH
[Added to the original trac issue at 8.14am, Friday, 26th August 2011]

You appear to be using ruby 1.9 which is completely untested.

Our code is written for, and runs on, ruby 1.8 based systems, and there are probably a number of changes that will needed for 1.9 support.

@openstreetmap-trac
Copy link
Author

Author: bithive
[Added to the original trac issue at 11.44pm, Monday, 2nd January 2012]

I have committed a fix for this problem to my github fork:

https://github.com/bithive/openstreetmap-website/commit/03991a45d93ed8a9e9430a940f3d55f6371433b7

There are other changes required for 1.9, look at the subsequent commits to the above fork.

@openstreetmap-trac
Copy link
Author

Author: TomH
[Added to the original trac issue at 12.03am, Tuesday, 3rd January 2012]

It's unlikely that we will try and support running on 1.9 until such time as I am in a position to easily test on it, which basically means when either Fedora or Ubuntu LTS has it.

@openstreetmap-trac
Copy link
Author

Author: ppawel[at]fastmail.fm
[Added to the original trac issue at 6.21am, Friday, 12th October 2012]

Works for me with ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]. Can be closed?

@openstreetmap-trac
Copy link
Author

Author: TomH
[Added to the original trac issue at 7.51am, Friday, 12th October 2012]

Yes I believe this is likely fine now as I have been running 1.9 on my development machine for some months now without encountering any further problems.

@openstreetmap-trac
Copy link
Author

Author: jfire
[Added to the original trac issue at 3.46pm, Friday, 12th October 2012]

Same here.

Is the production server still on 1.8? If so, we should consider updating, as 1.9 is significantly faster.

@openstreetmap-trac
Copy link
Author

Author: TomH
[Added to the original trac issue at 4.19pm, Friday, 12th October 2012]

Yes, because 1.8 is still what comes with Ubuntu.

@openstreetmap-trac
Copy link
Author

Author: TomH
[Added to the original trac issue at 4.21pm, Friday, 12th October 2012]

That said, we are actually using the ruby from http://ppa.launchpad.net/brightbox/ruby-ng/ubuntu now, which actually has both, so we could switch if we didn't mind committing to not being able to go back to the standard Ubuntu build.

I'd need to work out to do it non-disruptively though...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant