This discussion is locked
sh0tt

Q: FCS Web Review and Appoval

Ok, I followed the FinalCutIntegration Sample instructions and successfully setup the Rails app. It works when I have no clips for review, but once I try and add the first clip for review and return to the web interface I am face with this error:

"NoMethodError in Clips#index

Showing clips/index.html.erb where line #89 raised:

undefined method `length' for #<Enumerable::Enumerator:0x10590de08>"

Any help would be appreciated. I can provide the Full Trace if needed, just let me know and I will post it.

xServe 2x2.26 GHz Quad-Core Intel Xeon, Mac OS X (10.6.4), Final Cut Server 1.5

Posted on Jun 30, 2010 12:02 PM

Close

Q: FCS Web Review and Appoval

  • All replies
  • Helpful answers

  • by sh0tt,

    sh0tt sh0tt Jun 30, 2010 1:04 PM in response to sh0tt
    Level 1 (0 points)
    Jun 30, 2010 1:04 PM in response to sh0tt
    Figured out the problem...just paste the following code at the end of the environment.rb file

    module ActionView
    module Helpers
    module TextHelper
    def truncate(text, length = 30, truncate_string = "...")
    if text.nil? then return end
    l = length - truncatestring.chars.toa.size
    (text.chars.to_a.size > length ? text.chars.to_a[0...l].join + truncate_string : text).to_s
    end
    end
    end
    end
  • by fjak,

    fjak fjak Sep 22, 2010 5:25 AM in response to sh0tt
    Level 1 (0 points)
    Sep 22, 2010 5:25 AM in response to sh0tt
    Hi Robert,

    I'm having the same exact error but, the fix that you're posting doesn't resolve the issue.

    In fact, it makes the server crash on stat-up.

    Perhaps it's just the board displaying the information wrongfully.

    Would you mind confirming that what we see is what it should be?


    ** Starting Rails with development environment...
    Exiting
    /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gemoriginalrequire': >/XXX/XXX/XXX/review/config/environment.rb:69: syntax error, unexpected tSYMBEG (SyntaxError)
    ... length ? text.chars.to_ahttp://0...l.join + truncate_string...

    /XXX/XXX/XXX/review/config/environment.rb:69: syntax error, unexpected ':', expecting ')'
    ...0...l.join + truncate_string : text).to_s
    from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
  • by fjak,

    fjak fjak Sep 22, 2010 5:54 AM in response to fjak
    Level 1 (0 points)
    Sep 22, 2010 5:54 AM in response to fjak
    Exactly what I thought.

    module ActionView
    module Helpers
    module TextHelper
    def truncate(text, length = 30, truncate_string = "...")
    if text.nil? then return end
    l = length - truncatestring.chars.toa.size
    (text.chars.to_a.size > length ? text.chars.to_ah...l.join + truncate_string : text).to_s
    end
    end
    end
    end


    Be careful, the board code may add "http://..." just after the "to_ah...."

    That was my issue from copy/pasting the solution from the top here.

    ty