tj3man raises ruby syntax error

74 views
Skip to first unread message

Frank Dordowsky

unread,
Aug 15, 2015, 1:03:56 AM8/15/15
to TaskJuggler Users
When executing tj3man, I get the following error trace:

Code hier eingeben.../usr/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': /usr/lib/ruby/vendor_ruby/2.2.0/taskjuggler/KeywordDocumentation.rb:449: syntax error, unexpected keyword_do_cond, expecting ':' (SyntaxError)
/usr/lib/ruby/vendor_ruby/2.2.0/taskjuggler/KeywordDocumentation.rb:451: syntax error, unexpected ':', expecting keyword_end
            end : nil
                 ^
/usr/lib/ruby/vendor_ruby/2.2.0/taskjuggler/KeywordDocumentation.rb:460: syntax error, unexpected keyword_do_cond, expecting keyword_end
/usr/lib/ruby/vendor_ruby/2.2.0/taskjuggler/KeywordDocumentation.rb:461: syntax error, unexpected keyword_do_cond, expecting keyword_end
/usr/lib/ruby/vendor_ruby/2.2.0/taskjuggler/KeywordDocumentation.rb:462: syntax error, unexpected keyword_do_cond, expecting keyword_end
/usr/lib/ruby/vendor_ruby/2.2.0/taskjuggler/KeywordDocumentation.rb:471: syntax error, unexpected keyword_end, expecting end-of-input
    from /usr/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `
require'
    from /usr/lib/ruby/vendor_ruby/2.2.0/taskjuggler/SyntaxReference.rb:14:in `<top (required)>'

   
from /usr/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /usr/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `
require'
    from /usr/lib/ruby/vendor_ruby/2.2.0/taskjuggler/apps/Tj3Man.rb:16:in `<top (required)>'

   
from /usr/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /usr/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `
require'
    from /usr/lib/ruby/vendor_ruby/2.2.0/tj3man.rb:14:in `<top (required)>'

   
from /usr/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /usr/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `
require'
    from /usr/bin/tj3man:4:in `<main>'



I have ruby 2.2.2-1 installed I do not know anything about Ruby, so any help is appreciated.
Message has been deleted

James Watson

unread,
Aug 16, 2015, 7:44:30 AM8/16/15
to TaskJuggler Users
I have ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux] installed (Fedora 22) and am seeing the same thing.  I'd also appreciate any help with this.
Message has been deleted

James Watson

unread,
Aug 22, 2015, 6:25:47 AM8/22/15
to TaskJuggler Users
I've fixed this by modifying the following file;

/usr/lib/ruby/vendor_ruby/2.2.0/taskjuggler/KeywordDocumentation.rb

Original file (around line 443);

def generateHTMLSupportLevel
if @pattern.supportLevel != :supported
  [
    P.new do
      newRichText("<fcol:red>#{supportLevelMessage}</fcol>").to_html
    end,
    [ :deprecated, :removed ].include?(@pattern.supportLevel) ?
      P.new do
        useInsteadMessage
      end : nil
    ]
else

to the following;

def generateHTMLSupportLevel
if @pattern.supportLevel != :supported
  [
    P.new do
      newRichText("<fcol:red>#{supportLevelMessage}</fcol>").to_html
    end,
    if [ :deprecated, :removed ].include?(@pattern.supportLevel) 
      P.new do
        useInsteadMessage
      end
    end
  ]
else

I've never done anything with Ruby before so I'm not sure if this is correct but it does seem to get the tl3man documentation working.

Chris Schlaeger

unread,
Aug 22, 2015, 7:02:08 AM8/22/15
to taskjugg...@googlegroups.com, James Watson
That will not render the deprecation warnings. But thanks for trying to
fix it. I've just committed a proper fix that hopefully will eliminate
the problem with Ruby 2.2.2. I don't have this version installed yet, so
I can't test it right now. Please report back if it works or not. The
fix is in the Git repository.

Thanks,
Chris

James Watson

unread,
Aug 22, 2015, 10:12:49 AM8/22/15
to TaskJuggler Users, leica...@gmail.com
Hello Chris,

Thankyou very much for the quick response.  I've uninstalled my copy of taskjuggler, cloned the repository and installed from the updated code using the following commands (executed from the newly created Taskjuggler directory);

$ sudo gem uninstall taskjuggler
$ gem build taskjuggler.gemspec
$ sudo gem install ./taskjuggler-3.5.0.gem

The updated tj3man commands now work perfectly on a standard Fedora 22 install (ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux])

Kind regards

James

Frank Dordowsky

unread,
Sep 7, 2015, 12:25:15 PM9/7/15
to TaskJuggler Users
Sorry for my late answer but I have been offline for the last two weeks. I have applied the fix located on the Git for the file KeywordDocumentation.rb  locally since I prefer to stay with the Archlinux packaging. It works now also for me. Thanks very much for your help.

Frank


M. Jakov.

unread,
Oct 24, 2015, 4:36:51 PM10/24/15
to TaskJuggler Users
Hi!
I have found that setting ruby version to 2.0.0 with rvm and then installing taskjuggler v.3.5 with bundler works.
The workflow looks something like this:
1. create a .rvmrc file in your working directory containing the line:
rvm use 2.0.0
2. create a Gemfile with the entry:
source 'https://rubygems.org'

gem 'taskjuggler','3.5.0'
3.run: bundle install
4. bundle exec tj3man

And you are ready to go :)
Reply all
Reply to author
Forward
0 new messages