Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install error in chiliproject when migrate_plugins #159

Open
farseerfc opened this issue May 6, 2012 · 2 comments
Open

install error in chiliproject when migrate_plugins #159

farseerfc opened this issue May 6, 2012 · 2 comments

Comments

@farseerfc
Copy link

I was install this in chiliproject.
I typed

root@valkyrie:chiliproject# RAILS_ENV=production bundle exec rake db:migrate_plugins

And it gives me:

rake aborted!
/home/chiliproject/vendor/plugins/redmine_git_hosting/lib/git_hosting.
rb:62: syntax error, unexpected ':', expecting keyword_then or ';' or '\n'
/home/chiliproject/vendor/plugins/redmine_git_hosting/lib/git_hosting.
rb:86: syntax error, unexpected ':', expecting keyword_then or ';' or '\n'
/home/chiliproject/vendor/plugins/redmine_git_hosting/lib/git_hosting.
rb:105: syntax error, unexpected keyword_end, expecting $end

Tasks: TOP => db:migrate_plugins => db:migrate:plugins => environment
(See full trace by running task with --trace)

Is this some Version Error?

@Flast
Copy link

Flast commented May 15, 2012

I encountered same problem in my environment (with Ruby 1.9.3p194).

Workaround is here and it seems to work fine for me. (only remove trailing colon)

diff --git lib/git_adapter_hooks.rb lib/git_adapter_hooks.rb
index 0288f12..deed32b 100755
--- lib/git_adapter_hooks.rb
+++ lib/git_adapter_hooks.rb
@@ -8,7 +8,7 @@ module GitHosting
        @@check_hooks_installed_cached = nil

        def self.check_hooks_installed
-           if not @@check_hooks_installed_cached.nil? and (Time.new - @@check_hooks_installed_stamp <= 0.5):
+           if not @@check_hooks_installed_cached.nil? and (Time.new - @@check_hooks_installed_stamp <= 0.5)
                return @@check_hooks_installed_cached
            end

diff --git lib/git_hosting.rb lib/git_hosting.rb
index 8bcea34..adaaef8 100755
--- lib/git_hosting.rb
+++ lib/git_hosting.rb
@@ -59,7 +59,7 @@ module GitHosting
    @@sudo_git_to_web_user_stamp = nil
    @@sudo_git_to_web_user_cached = nil
    def self.sudo_git_to_web_user
-       if not @@sudo_git_to_web_user_cached.nil? and (Time.new - @@sudo_git_to_web_user_stamp <= 0.5):
+       if not @@sudo_git_to_web_user_cached.nil? and (Time.new - @@sudo_git_to_web_user_stamp <= 0.5)
            return @@sudo_git_to_web_user_cached
        end
        logger.info "Testing if git user(\"#{git_user}\") can sudo to web user(\"#{web_user}\")"
@@ -83,7 +83,7 @@ module GitHosting
    @@sudo_web_to_git_user_stamp = nil
    @@sudo_web_to_git_user_cached = nil
    def self.sudo_web_to_git_user
-       if not @@sudo_web_to_git_user_cached.nil? and (Time.new - @@sudo_web_to_git_user_stamp <= 0.5):
+       if not @@sudo_web_to_git_user_cached.nil? and (Time.new - @@sudo_web_to_git_user_stamp <= 0.5)
            return @@sudo_web_to_git_user_cached
        end
        logger.info "Testing if web user(\"#{web_user}\") can sudo to git user(\"#{git_user}\")"

However, I'm not ruby programmer and I don't know about backward compatibility.

@farseerfc
Copy link
Author

Thanks, this works for me!
But why it seems like python ...

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

No branches or pull requests

2 participants