1

I am using Rails 4.1.6 and Ruby 2.1.5.

I have the following code, but I am getting an error:

params = {
  input: @model.video.url,
  test: true,
  notifications: [zencoder_url],
  pass_through: @model.id
  outputs: [
    {
      public:       true,
      base_url:     base_url,
      filename:     "mp4_" + filename_without_ext + '.mp4',
      label:        'webmp4',
      format:       'mp4',
      audio_codec:  'aac',
      video_codec:  'h264'
    },
    {
      public:       true,
      base_url:     base_url,
      filename:     "web_" + filename_without_ext + '.webm',
      label:        'webwebm',
      format:       'webm',
      audio_codec:  'vorbis',
      video_codec:  'vp8'          
    },
    {
      public:       true,
      base_url:     base_url,
      filename:     "ogv_" + filename_without_ext + '.ogv',
      label:        'webogv',
      format:       'ogv',
      audio_codec:  'vorbis',
      video_codec:  'theora'          
    },
    {
      thumbnails: {
        public:       true,
        base_url:     base_url,
        filename:     "thumbnail_" + filename_without_ext,
        times:        [3],
        aspect_mode:  'preserve',
        width:        '100',
        height:       '100'
      }
    }
  ]
}

This is the error I get when trying to visit any page in my app:

Started GET "/" for 127.0.0.1 at 2015-05-14 00:26:08 -0500
  ActiveRecord::SchemaMigration Load (3.0ms)  SELECT "schema_migrations".* FROM "schema_migrations"
  User Load (6.3ms)  SELECT  "users".* FROM "users"  WHERE "users"."id" = 57  ORDER BY "users"."id" ASC LIMIT 1
Processing by DashboardController#index as HTML
Completed 500 Internal Server Error in 12ms

SyntaxError - syntax error, unexpected tIDENTIFIER, expecting '}'
      outputs: [
             ^
/app/uploaders/video_uploader.rb:102: syntax error, unexpected '}', expecting keyword_end:

What could be causing this error? The syntax seems legit for me. I don't seem to be missing any curly braces or square brackets.

marcamillion
  • 32,933
  • 55
  • 189
  • 380

1 Answers1

4
 pass_through: @model.id

The , is missing.

pangpang
  • 8,581
  • 11
  • 60
  • 96
  • Ahhh...ofcourse. Thanks much meng. I haven't even tested it, but that seems accurate! Edit: Tested, and that was right! – marcamillion May 14 '15 at 05:29
  • @marcamillion since this answer helped you, please mark the answer as correct. – Mohammad AbuShady May 14 '15 at 06:03
  • @MohammadAbuShady, answers are not selected because they are correct; an answer is selected because it is the one the OP found most useful. In this case, there may be no other answers, but in general, there's no rush in selecting an answer, the OP must just remember to do so eventually (provided at least one answer was helpful). Many SO members wait at least a few hours before selecting an answer. A quick selection may discourage other, possibly better, answers, and is discourteous to those still working on their answers when the greenie flashes on. – Cary Swoveland May 14 '15 at 06:13
  • @CarySwoveland I just wanted to remind him, cause a lot of questions get answered and the OP confirms the answer, but they stay unsolved. A lot of times i go through questions and spend a few mins reading the question just to find out that it was already answered in a comment. – Mohammad AbuShady May 14 '15 at 08:05
  • I intended to mark it correct, but he answered so quickly that SO prevented me. I left the tab open to remember, so I just did. Thanks for the reminder anyhow @MohammadAbuShady – marcamillion May 14 '15 at 08:50