部署到Heroku时编译失败资产

时间:2013-03-15 08:08:35

标签: ruby-on-rails ruby coffeescript asset-pipeline

我想将我的Rails应用程序部署到heroku但资源编译失败。在当地环境中,它运作良好。

       Your bundle is complete! It was installed into ./vendor/bundle
       Cleaning up the bundler cache.
-----> Writing config/database.yml to read from DATABASE_URL
-----> Preparing app for Rails asset pipeline
       Running: rake assets:precompile
       rake aborted!
       Error: Parse error on line 13: Unexpected 'INDENT'
       (in /tmp/build_iztv4ybnwpqh/app/assets/javascripts/require_dir/view_after
_key_recieve.js.coffee)

日志说第13行有意外的缩进,但我找不到任何错误。

root = exports ? this
class root.ViewAfterKeyRecieveViewModel
  constructor: ->
    @isDecoded = ko.observable false
    @encryptedKey = ko.observable ''
    @personalPassword = ko.observable ''
    @decodePassword = ''

    # do when @personalPassword is changed
    ko.computed =>
      if @personalPassword() isnt ''
        @decodePassword = sjcl.decrypt(@personalPassword(), @encryptedKey())
      simg = new ScrambledImage044 "/assets/image61.png" # THIS IS LINE 13
        height: 16
        width:  12
        canvasId: 'original'
        seed:   @decodePassword
      simg.fix()
      simg.paint()

  createEncryptedKey: ->
    # create key and set to @encryptedKey
    @encryptedKey sjcl.encrypt("todo", "hirakegoma")

谢谢你的善意。

1 个答案:

答案 0 :(得分:1)

试试这个:

simg = new ScrambledImage044 "/assets/image61.png",  # notice the comma
    height: 16
    width:  12
    canvasId: 'original'
    seed:   @decodePassword

或者这个:

simg = new ScrambledImage044( "/assets/image61.png"
    height: 16
    width:  12
    canvasId: 'original'
    seed:   @decodePassword
) # notice the parens