- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
我在将 Rails 项目推送到 heroku 时遇到问题。我收到“预编译 Assets 失败”消息。我是编程新手,也是 ruby on rails 新手。我真的需要一些帮助。这是我的命令行中的文本。
$ git push heroku master
Counting objects: 76, done.
Compressing objects: 100% (63/63), done.
Writing objects: 100% (76/76), 27.38 KiB | 11.00 KiB/s, done.
Total 76 (delta 4), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.0.0
remote: ###### WARNING:
remote: Removing `Gemfile.lock` because it was generated on Windows.
remote: Bundler will do a full resolve so native gems are handled properl
y.
remote: This may result in unexpected gem versions being used in your app
.
remote: In rare occasions Bundler may not be able to resolve your depende
ncies at all.
remote: https://devcenter.heroku.com/articles/bundler-windows-gemfile
remote:
remote: -----> Installing dependencies using 1.9.7
remote: Running: bundle install --without development:test --path vendor/
bundle --binstubs vendor/bundle/bin -j4
remote: Fetching gem metadata from https://rubygems.org/............
remote: Fetching version metadata from https://rubygems.org/...
remote: Fetching dependency metadata from https://rubygems.org/..
remote: Resolving dependencies....
remote: Rubygems 2.0.14 is not threadsafe, so your gems must be installed
one at a time. Upgrade to Rubygems 2.1.0 or higher to enable parallel gem insta
llation.
remote: Installing rake 10.4.2
remote: Installing i18n 0.7.0
remote: Installing multi_json 1.11.0
remote: Installing activesupport 3.2.21
remote: Installing builder 3.0.4
remote: Installing activemodel 3.2.21
remote: Installing erubis 2.7.0
remote: Installing journey 1.0.4
remote: Installing rack 1.4.5
remote: Installing rack-cache 1.2
remote: Installing rack-test 0.6.3
remote: Installing hike 1.2.3
remote: Installing tilt 1.4.1
remote: Installing sprockets 2.2.3
remote: Installing actionpack 3.2.21
remote: Installing mime-types 1.25.1
remote: Installing polyglot 0.3.5
remote: Installing treetop 1.4.15
remote: Installing mail 2.5.4
remote: Installing actionmailer 3.2.21
remote: Installing arel 3.0.3
remote: Installing tzinfo 0.3.44
remote: Installing activerecord 3.2.21
remote: Installing activeresource 3.2.21
remote: Using bundler 1.9.7
remote: Installing coffee-script-source 1.9.1.1
remote: Installing execjs 2.5.2
remote: Installing coffee-script 2.4.1
remote: Installing rack-ssl 1.3.4
remote: Installing json 1.8.2
remote: Installing rdoc 3.12.2
remote: Installing thor 0.19.1
remote: Installing railties 3.2.21
remote: Installing coffee-rails 3.2.2
remote: Installing jquery-rails 3.1.2
remote: Installing pg 0.18.2
remote: Installing rails 3.2.21
remote: Installing sass 3.4.14
remote: Installing sass-rails 3.2.6
remote: Installing uglifier 2.7.1
remote: Bundle complete! 6 Gemfile dependencies, 40 gems now installed.
remote: Gems in the groups development and test were not installed.
remote: Bundled gems are installed into ./vendor/bundle.
remote: Post-install message from rdoc:
remote: Depending on your version of ruby, you may need to install ruby r
doc/ri data:
remote: <= 1.8.6 : unsupported
remote: = 1.8.7 : gem install rdoc-data; rdoc-data --install
remote: = 1.9.1 : gem install rdoc-data; rdoc-data --install
remote: >= 1.9.2 : nothing to do! Yay!
remote: Bundle completed (54.39s)
remote: Cleaning up the bundler cache.
remote: -----> Writing config/database.yml to read from DATABASE_URL
remote: -----> Preparing app for Rails asset pipeline
remote: Running: rake assets:precompile
remote: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/p
lugins! Support for these plugins will be removed in Rails 4.0. Move them out an
d bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and
config/initializers/myplugin.rb. See the release notes for more on this: http:/
/weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from
<top (required)> at /tmp/build_7f6590528210ec3b45a43e69c0119446/Rakefile:7)
remote: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/p
lugins! Support for these plugins will be removed in Rails 4.0. Move them out an
d bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and
config/initializers/myplugin.rb. See the release notes for more on this: http:/
/weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from
<top (required)> at /tmp/build_7f6590528210ec3b45a43e69c0119446/Rakefile:7)
remote: rake aborted!
remote: ExecJS::ProgramError: Unexpected token: operator (=) (line: 10770
, col: 0, pos: 300859)
remote: Error
remote: at new JS_Parse_Error (/tmp/execjs20150523-743-1p3uckwjs:2359:106
23)
remote: at js_error (/tmp/execjs20150523-743-1p3uckwjs:2359:10842)
remote: at croak (/tmp/execjs20150523-743-1p3uckwjs:2359:19086)
remote: at token_error (/tmp/execjs20150523-743-1p3uckwjs:2359:19223)
remote: at unexpected (/tmp/execjs20150523-743-1p3uckwjs:2359:19311)
remote: at expr_atom (/tmp/execjs20150523-743-1p3uckwjs:2359:27526)
remote: at maybe_unary (/tmp/execjs20150523-743-1p3uckwjs:2359:30019)
remote: at expr_ops (/tmp/execjs20150523-743-1p3uckwjs:2359:30777)
remote: at maybe_conditional (/tmp/execjs20150523-743-1p3uckwjs:2359:3086
9)
remote: at maybe_assign (/tmp/execjs20150523-743-1p3uckwjs:2359:31312)
remote: at expression (/tmp/execjs20150523-743-1p3uckwjs:2359:31625)
remote: at simple_statement (/tmp/execjs20150523-743-1p3uckwjs:2359:22563
)
remote: at /tmp/execjs20150523-743-1p3uckwjs:2359:20468
remote: (in /tmp/build_7f6590528210ec3b45a43e69c0119446/app/assets/javasc
ripts/application.js)new JS_Parse_Error ((execjs):2359:10623)
remote: js_error ((execjs):2359:10842)
remote: croak ((execjs):2359:19086)
remote: token_error ((execjs):2359:19223)
remote: unexpected ((execjs):2359:19311)
remote: expr_atom ((execjs):2359:27526)
remote: maybe_unary ((execjs):2359:30019)
remote: expr_ops ((execjs):2359:30777)
remote: maybe_conditional ((execjs):2359:30869)
remote: maybe_assign ((execjs):2359:31312)
remote: expression ((execjs):2359:31625)
remote: simple_statement ((execjs):2359:22563)
remote: (execjs):2359:20468
remote: /tmp/build_7f6590528210ec3b45a43e69c0119446/vendor/bundle/ruby/2.
0.0/gems/execjs-2.5.2/lib/execjs/external_runtime.rb:39:in `exec'
remote: /tmp/build_7f6590528210ec3b45a43e69c0119446/vendor/bundle/ruby/2.
0.0/gems/execjs-2.5.2/lib/execjs/external_runtime.rb:21:in `eval'
remote: /tmp/build_7f6590528210ec3b45a43e69c0119446/vendor/bundle/ruby/2.
0.0/gems/execjs-2.5.2/lib/execjs/external_runtime.rb:46:in `call'
remote: /tmp/build_7f6590528210ec3b45a43e69c0119446/vendor/bundle/ruby/2.
0.0/gems/uglifier-2.7.1/lib/uglifier.rb:212:in `run_uglifyjs'
remote: /tmp/build_7f6590528210ec3b45a43e69c0119446/vendor/bundle/ruby/2.
0.0/gems/uglifier-2.7.1/lib/uglifier.rb:179:in `compile'
remote: /tmp/build_7f6590528210ec3b45a43e69c0119446/vendor/bundle/ruby/2.
0.0/gems/actionpack-3.2.21/lib/sprockets/compressors.rb:74:in `compress'
remote: /tmp/build_7f6590528210ec3b45a43e69c0119446/vendor/bundle/ruby/2.
0.0/gems/sprockets-2.2.3/lib/sprockets/processing.rb:265:in `block in js_compres
sor='
remote: /tmp/build_7f6590528210ec3b45a43e69c0119446/vendor/bundle/ruby/2.
0.0/gems/sprockets-2.2.3/lib/sprockets/processor.rb:29:in `call'
remote: /tmp/build_7f6590528210ec3b45a43e69c0119446/vendor/bundle/ruby/2.
0.0/gems/sprockets-2.2.3/lib/sprockets/processor.rb:29:in `evaluate'
remote: /tmp/build_7f6590528210ec3b45a43e69c0119446/vendor/bundle/ruby/2.
0.0/gems/tilt-1.4.1/lib/tilt/template.rb:103:in `render'
remote: /tmp/build_7f6590528210ec3b45a43e69c0119446/vendor/bundle/ruby/2.
0.0/gems/sprockets-2.2.3/lib/sprockets/context.rb:193:in `block in evaluate'
remote: /tmp/build_7f6590528210ec3b45a43e69c0119446/vendor/bundle/ruby/2.
0.0/gems/sprockets-2.2.3/lib/sprockets/context.rb:190:in `each'
remote: /tmp/build_7f6590528210ec3b45a43e69c0119446/vendor/bundle/ruby/2.
0.0/gems/sprockets-2.2.3/lib/sprockets/context.rb:190:in `evaluate'
remote: /tmp/build_7f6590528210ec3b45a43e69c0119446/vendor/bundle/ruby/2.
0.0/gems/sprockets-2.2.3/lib/sprockets/bundled_asset.rb:26:in `initialize'
remote: /tmp/build_7f6590528210ec3b45a43e69c0119446/vendor/bundle/ruby/2.
0.0/gems/sprockets-2.2.3/lib/sprockets/base.rb:252:in `new'
remote: /tmp/build_7f6590528210ec3b45a43e69c0119446/vendor/bundle/ruby/2.
0.0/gems/sprockets-2.2.3/lib/sprockets/base.rb:252:in `build_asset'
remote: /tmp/build_7f6590528210ec3b45a43e69c0119446/vendor/bundle/ruby/2.
0.0/gems/sprockets-2.2.3/lib/sprockets/index.rb:93:in `block in build_asset'
remote: /tmp/build_7f6590528210ec3b45a43e69c0119446/vendor/bundle/ruby/2.
0.0/gems/sprockets-2.2.3/lib/sprockets/caching.rb:19:in `cache_asset'
remote: /tmp/build_7f6590528210ec3b45a43e69c0119446/vendor/bundle/ruby/2.
0.0/gems/sprockets-2.2.3/lib/sprockets/index.rb:92:in `build_asset'
remote: /tmp/build_7f6590528210ec3b45a43e69c0119446/vendor/bundle/ruby/2.
0.0/gems/sprockets-2.2.3/lib/sprockets/base.rb:169:in `find_asset'
remote: /tmp/build_7f6590528210ec3b45a43e69c0119446/vendor/bundle/ruby/2.
0.0/gems/sprockets-2.2.3/lib/sprockets/index.rb:60:in `find_asset'
remote: /tmp/build_7f6590528210ec3b45a43e69c0119446/vendor/bundle/ruby/2.
0.0/gems/actionpack-3.2.21/lib/sprockets/static_compiler.rb:19:in `block in comp
ile'
remote: /tmp/build_7f6590528210ec3b45a43e69c0119446/vendor/bundle/ruby/2.
0.0/gems/sprockets-2.2.3/lib/sprockets/base.rb:219:in `block in each_logical_pat
h'
remote: /tmp/build_7f6590528210ec3b45a43e69c0119446/vendor/bundle/ruby/2.
0.0/gems/sprockets-2.2.3/lib/sprockets/base.rb:206:in `block (2 levels) in each_
file'
remote: /tmp/build_7f6590528210ec3b45a43e69c0119446/vendor/bundle/ruby/2.
0.0/gems/sprockets-2.2.3/lib/sprockets/base.rb:196:in `each'
remote: /tmp/build_7f6590528210ec3b45a43e69c0119446/vendor/bundle/ruby/2.
0.0/gems/sprockets-2.2.3/lib/sprockets/base.rb:196:in `each_entry'
remote: /tmp/build_7f6590528210ec3b45a43e69c0119446/vendor/bundle/ruby/2.
0.0/gems/sprockets-2.2.3/lib/sprockets/base.rb:204:in `block in each_file'
remote: /tmp/build_7f6590528210ec3b45a43e69c0119446/vendor/bundle/ruby/2.
0.0/gems/sprockets-2.2.3/lib/sprockets/base.rb:203:in `each'
remote: /tmp/build_7f6590528210ec3b45a43e69c0119446/vendor/bundle/ruby/2.
0.0/gems/sprockets-2.2.3/lib/sprockets/base.rb:203:in `each_file'
remote: /tmp/build_7f6590528210ec3b45a43e69c0119446/vendor/bundle/ruby/2.
0.0/gems/sprockets-2.2.3/lib/sprockets/base.rb:217:in `each_logical_path'
remote: /tmp/build_7f6590528210ec3b45a43e69c0119446/vendor/bundle/ruby/2.
0.0/gems/actionpack-3.2.21/lib/sprockets/static_compiler.rb:18:in `compile'
remote: /tmp/build_7f6590528210ec3b45a43e69c0119446/vendor/bundle/ruby/2.
0.0/gems/actionpack-3.2.21/lib/sprockets/assets.rake:56:in `internal_precompile'
remote: /tmp/build_7f6590528210ec3b45a43e69c0119446/vendor/bundle/ruby/2.
0.0/gems/actionpack-3.2.21/lib/sprockets/assets.rake:70:in `block (3 levels) in
<top (required)>'
remote: /tmp/build_7f6590528210ec3b45a43e69c0119446/vendor/bundle/ruby/2.
0.0/gems/actionpack-3.2.21/lib/sprockets/assets.rake:60:in `block (3 levels) in
<top (required)>'
remote: /tmp/build_7f6590528210ec3b45a43e69c0119446/vendor/bundle/ruby/2.
0.0/gems/actionpack-3.2.21/lib/sprockets/assets.rake:23:in `invoke_or_reboot_rak
e_task'
remote: /tmp/build_7f6590528210ec3b45a43e69c0119446/vendor/bundle/ruby/2.
0.0/gems/actionpack-3.2.21/lib/sprockets/assets.rake:29:in `block (2 levels) in
<top (required)>'
remote: Tasks: TOP => assets:precompile:primary
remote: (See full trace by running task with --trace)
remote: !
remote: ! Precompiling assets failed.
remote: !
remote:
remote: ! Push rejected, failed to compile Ruby app
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to whispering-chamber-4883.
remote:
To https://git.heroku.com/whispering-chamber-4883.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/whispering-chamber-48
83.git'
谢谢。
最佳答案
您现在可能已经解决了这个问题,但我偶然发现了这个问题并想分享我的解决方案。
正如上面的答案所建议的那样,将错误跟踪到有问题的文件的最佳方法是运行
rake Assets :预编译 RAILS_ENV=production
在本地同时排除您可能认为包含问题的文件或目录。我一个一个地删除目录(稍后我可以从我的存储库中再次 check out )直到我运行预编译。然后我深入到最后删除的目录并将其跟踪到某个文件和表单的函数
array.find(name => name.id === user_id);
我的研究表明,Javascript (ES5) 的最大更新是在 2009 年发布的,从那时起,直到 2015 年 6 月,ECMAScript 6 (ES6) 最终规范才发布。此函数中使用的语法受 ES6 支持,但 ES5 不支持,Rails 尚不支持 ES6(我运行的是 RoR 5.0.0.1),至少 Assets 管道上的 ExecJS 不支持。
您可以做的是将您的函数更改为另一种语法,即
array.find(function(name){return name.id === user_id});
它应该等效地工作。
关于ruby-on-rails - 预编译 Assets 失败 ExecJS::ProgramError: Unexpected token: operator (=) (line: 10770, col: 0, pos: 300859),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30417990/
我在我的应用程序中使用rails 4 和 ruby 1.9.3 以及fancybox2-rails gem,但是 Assets 管道存在一个普遍问题。如果我运行 rake task 进行预编译,那
我把我所有的 Assets 都放在我的包里例如myBundle/Resources/public/css/ 然后像这样加载它们: {% block stylesheets %} {{ parent()
我正在创建RoR-6应用程序,并从此行的application.html.erb文件中引发以下错误: javascript_include_tag 'application', 'data-turbo
我正在对 Play Subproject 功能进行更多扩展测试,如下所述:http://www.playframework.com/documentation/2.0/SBTSubProjects .
我是 symfony 2 和 Assetic 的新手。我想在 CSS 中使用 assetic 和 Sass。我使用自定义字体。我在资源下的包中创建文件夹“assets/css”,里面有 _base.s
这是我的目录结构(这只是一个测试项目): stan@mypc:/generate_assets$ sudo tree -L 3 -p . ├── [drwxr-xr-x] assets │ └─
我使用 node.js connect/express。 有人知道支持 TypeScript 源代码即时编译和缩小的 Assets 管理器吗? 知道如何以编程方式调用编译器吗? 我一直在使用 conn
因此,我们在 Assets 管道摘要方面遇到了一个小问题,因为我们有许多 HTML 模板作为 Assets (对于 AngularJS),并且我们使用 asset_path 在 Javascript
我想从iPad的照片库中获取图像URL。 当我尝试从Image Piicker的信息中获取 UIImagePickerControllerReferenceURL 时 我将URL设为: assets
我正在使用带有Assetic的Symfony 2.1.10版,并且在上次 Composer 更新之后,当我尝试运行php app/console assetic:dump时出现以下错误 Dumping
我的 Assets 管道有问题,我已经有一个名为 Assets 的资源/ Controller 。所以我已将 assets.prefix 选项更改为“/externals”。 config.asset
更新到 Expo sdk 34 后,出现此错误:TypeError:Asset.fromModule 不是函数。 (在“Asset.fromModule(image)”中,“Asset.fromMod
将 Play 框架项目从 2.2.4 迁移到 2.3.8 后遇到问题: 这是运行命令“activatorcompile”的错误输出: [error] ...\workspace\testproject
我在将 Google Analytics 添加到我的 Rails 4 应用程序时遇到了一些困难(参见 this post)。 我通过在 /public/assets/google-analytics.
我正在使用 Symfony2 和 Assetic。最近我一直在做很多 CSS 工作,所以在某个时候我需要命令 $ php app/console assetic:dump --env=prod --n
我正在 Android 开发中迈出第一步,并遇到了 Assets 一词。 据我了解, Assets 只是一个未被解析或引用为资源的文件。 这个词有更准确的定义吗?我应该在哪些情况下在我的应用程序中使用
我添加了 danial-farid--angular-file-upload通过 Rails Assets 将库添加到我的 Rails 4 应用程序。主库加载正常,但 sprockets 找不到它包含
这是我的代码,尽管编码非常粗糙: public void loadStack(AssetManager manager, String path) { String[] lis
我正在使用 Assets 管理我的 Symfony 2 框架中的 CSS 文件。它在生产模式下运行良好。 我的问题是在 Debug模式下,assetic 不断将我的文件合并为一个输出文件。这使得跟踪特
我想以编程方式从重复的相册中删除 Assets (照片不是)。我可以使用照片框架删除相册 我想知道如何从相册中删除 Assets 而不从照片应用中完全删除它。我想在多个地方使用它,例如将 Assets
我是一名优秀的程序员,十分优秀!