我尝试通过以下操作添加操作文本:https://stackoverflow.com/a/55983943。
在开发中一切正常。
但是当我尝试通过运行git push heroku将其推送到heroku时,出现此错误:
remote: !
remote: ! Precompiling assets failed.
remote: !
remote: ! Push rejected,failed to compile Ruby app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to sampleapp.
remote:
remote:
To https://git.heroku.com/sampleapp.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/sampleapp.git'
我尝试添加
config.assets.initialize_on_precompile = false
到config / application.rb,但是没有用
它已经添加到config / environments / production.rb。
我尝试运行RAILS_ENV =生产捆绑包exec rake资产:预编译 但这给了我这个错误:
ExecJS::RuntimeError: SyntaxError: Unexpected token: string (actiontext)
JS_Parse_Error.get ((execjs):3538:621)
那么,如何解决此错误?