Tag: heroku

Rails不会预编译.js.erb

为什么Rails不会预编译.js.erb资产? 我的config/application.rb : require File.expand_path(‘../boot’, __FILE__) require ‘rails/all’ Bundler.require(:default, Rails.env) module Sflitmap class Application < Rails::Application # these precompile OK config.assets.precompile += ['edge/edge.1.5.0.min.js', 'edge/ink-falling_edgeActions.js', 'edge/inkAnimationTrigger.js'] # this will not precompile config.assets.precompile += ['edge/ink-falling_edge.js.erb'] end end 我的config/environments/production.rb : Sflitmap::Application.configure do # Settings specified here will take precedence over those in config/application.rb. # Code is not reloaded […]

Heroku 500内部服务器错误未定义方法’用户名’为nil:NilClass

我的应用程序能够在我的本地服务器上运行得很好,但当我将它从git推送到heroku时,它不能在heroku上运行。 我运行heroku运行rake db:migrate,但仍然没有运气。 我猜它与用户名方法有关,但不确定为什么它可以在我的本地而不是在heroku上工作。 2013-03-01T05:45:00+00:00 app[web.1]: 2013-03-01T05:45:00+00:00 app[web.1]: 11: 2013-03-01T05:45:00+00:00 app[web.1]: app/views/pins/index.html.erb:4:in `_app_views_pins_index_html_erb__3245926179851309408_37549160′ 2013-03-01T05:45:00+00:00 app[web.1]: cache: [GET /] miss 2013-03-01T05:45:00+00:00 app[web.1]: 2013-03-01T05:45:01+00:00 app[web.1]: 2013-03-01T05:45:01+00:00 app[web.1]: Started GET “/” for 99.190.128.33 at 2013-03-01 05:45:01 +0000 2013-03-01T05:45:01+00:00 app[web.1]: 2013-03-01T05:45:01+00:00 app[web.1]: Processing by PinsController#index as HTML 2013-03-01T05:45:01+00:00 heroku[router]: at=info method=GET path=/ host=railsapp- test.herokuapp.com fwd=”99.190.128.33″ dyno=web.1 queue=0 wait=0ms connect=0ms […]

预编译资产失败

我正在推动一个我几个月没有更新的应用程序,我遇到了这个问题。 我只在代码中更改了一些变量。 不知道为什么突然这样对我。 ! ! Precompiling assets failed. ! ! Push rejected, failed to compile Ruby app To git@heroku.com:myapp.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to ‘git@heroku.com:myapp.git’ rake aborted! could not connect to server: Connection refused Is the server running on host “127.0.0.1” and accepting TCP/IP […]

Heroku 500错误,使用Heroku时,Rails

我正在尝试使用回形针将图像上传到S3。 它目前在开发中完美运行,但是当我将它推送到heroku时,我获得了500的状态。 我查看了当前的主题,其中一些原因是缺少pg gem和未配置的存储桶名称,但我已经检查了这些。 我的错误日志目前说这个 2014-06-22T23:13:44.118505+00:00 app[web.1]: I, [2014-06-22T23:13:44.118013 #2] INFO — : Command :: convert ‘/tmp/eba6328b7631122493d269f7c5d3781d20140622-2-1f1t7y3[0]’ -auto-orient -resize “x100” -crop “100×100+99+0” +repage -set colorspace sRGB -strip ‘/tmp/eba6328b7631122493d269f7c5d3781d20140622-2-1f1t7y320140622-2-10cae74.jpg’ 2014-06-22T23:13:44.040021+00:00 app[web.1]: I, [2014-06-22T23:13:31.758844 #2] INFO — : Rendered patients/new.html.erb within layouts/application (2.6ms) 2014-06-22T23:13:44.040023+00:00 app[web.1]: I, [2014-06-22T23:13:31.759625 #2] INFO — : Completed 200 OK in 5ms (Views: […]

Heroku推送问题

我将我的应用程序推送到Heroku时出现问题。 当我尝试使用“git push heroku master”时,下面是我的终端输出 Counting objects: 22, done. Delta compression using up to 8 threads. Compressing objects: 100% (22/22), done. Writing objects: 100% (22/22), 2.16 KiB | 2.16 MiB/s, done. Total 22 (delta 15), reused 0 (delta 0) remote: Compressing source files… done. remote: Building source: remote: remote: —–> Ruby app detected remote: —–> […]

ActionView :: Template :: Error(在heroku上没有将Fixnum隐式转换为String

我正在使用Mongodb.App正在使用ROR应用程序在localhost上正常工作,但是当我在heroku中部署它时,我收到错误。 我的一个视图文件命令是这样的: @h=Portfolio.last.folders Portfolio是一个将字段文件夹作为数组的集合。 生产中的Mongodb包含这个。 即使我尝试在heroku rails控制台中做同样的事情我也得到了同样的错误: TypeError: no implicit conversion of Fixnum into String from /app/vendor/bundle/ruby/2.0.0/gems/moped-1.4.3/lib/moped/protocol/commands/authenticate.rb:35:in `+’ from /app/vendor/bundle/ruby/2.0.0/gems/moped-1.4.3/lib/moped/protocol/commands/authenticate.rb:35:in `digest’ from /app/vendor/bundle/ruby/2.0.0/gems/moped-1.4.3/lib/moped/protocol/commands/authenticate.rb:47:in `build_auth_command’ from /app/vendor/bundle/ruby/2.0.0/gems/moped-1.4.3/lib/moped/protocol/commands/authenticate.rb:25:in `initialize’ from /app/vendor/bundle/ruby/2.0.0/gems/moped-1.4.3/lib/moped/node.rb:488:in `new’ from /app/vendor/bundle/ruby/2.0.0/gems/moped-1.4.3/lib/moped/node.rb:488:in `login’ from /app/vendor/bundle/ruby/2.0.0/gems/moped-1.4.3/lib/moped/node.rb:48:in `block in apply_auth’ from /app/vendor/bundle/ruby/2.0.0/gems/moped-1.4.3/lib/moped/node.rb:47:in `each’ from /app/vendor/bundle/ruby/2.0.0/gems/moped-1.4.3/lib/moped/node.rb:47:in `apply_auth’ from /app/vendor/bundle/ruby/2.0.0/gems/moped-1.4.3/lib/moped/cluster.rb:250:in `with_secondary’ from /app/vendor/bundle/ruby/2.0.0/gems/moped-1.4.3/lib/moped/session/context.rb:104:in `with_node’ from /app/vendor/bundle/ruby/2.0.0/gems/moped-1.4.3/lib/moped/session/context.rb:43:in `query’ from /app/vendor/bundle/ruby/2.0.0/gems/moped-1.4.3/lib/moped/query.rb:115:in […]

Heroku上的act-as-taggable-on

我一直在我的开发应用程序中使用act-as-taggable-on进行标记,但是当我将它推送到Heroku时,我收到了一个令人讨厌的错误: ActionView::TemplateError (PGError: ERROR: relation “tags” does not exist : SELECT tags.*, taggings.tags_count AS count FROM “tags” JOIN (SELECT taggings.tag_id, COUNT(taggings.tag_id) AS tags_count FROM “taggings” INNER JOIN offers ON offers.id = taggings.taggable_id WHERE (taggings.taggable_type = E’Offer’ AND taggings.context = E’tags’) GROUP BY taggings.tag_id HAVING COUNT(*) > 0 AND COUNT(taggings.tag_id) > 0) AS taggings ON taggings.tag_id […]

如何在Heroku上调试“检测资产错误:预编译任务”问题

当推送到Heroku时,我们在输出中看到以下行: … Error detecting the assets:precompile task … 然后该应用程序将成功部署,但它将没有任何资产。 这非常令人沮丧,因为没有出现错误,我们也不知道可能会发生什么。 日志没有任何暗示。 这是推送终端输出的尾部 : Your bundle is complete! It was installed into ./vendor/bundle Cleaning up the bundler cache. —–> Writing config/database.yml to read from DATABASE_URL Error detecting the assets:precompile task —–> Discovering process types Procfile declares types -> (none) Default types for Ruby/Rails -> console, rake, […]

当我将我的应用程序推送到Heroku时,为什么我收到错误500“我们很抱歉,但出了点问题”?

我把我的应用程序推到了Heroku,我得到了“我们很抱歉,但出了点问题(500)”为什么会这样? 我知道错误消息来自我在/ public目录中的一个标题为500.html的文件,但我不确定为什么会这样。 我的heroku日志和我的mongoid.yml文件一样。 谢谢。 Heroku日志: 2014-02-23T02:12:14.311710+00:00 heroku[router]: at=info method=GET path=/ host=danacamilleapp.herokuapp.com request_id=25556ae0-c4ac-40f7-8008-bd8860b87039 fwd=”72.89.235.136″ dyno=web.1 connect=27ms service=18ms status=500 bytes=932 2014-02-23T02:12:14.311277+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/mongoid-3.1.6/lib/mongoid/sessions.rb:171:in `collection’ 2014-02-23T02:12:14.311277+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/mongoid-3.1.6/lib/mongoid/sessions.rb:137:in `with_name’ 2014-02-23T02:12:14.311520+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/mongoid-3.1.6/lib/mongoid/contextual.rb:34:in `context’ 2014-02-23T02:12:14.311277+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/mongoid-3.1.6/lib/mongoid/sessions/factory.rb:28:in `create’ 2014-02-23T02:12:14.311277+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/mongoid-3.1.6/lib/mongoid/sessions/factory.rb:122:in `inject_ports’ 2014-02-23T02:12:14.311520+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/mongoid-3.1.6/lib/mongoid/contextual/mongo.rb:260:in `initialize’ 2014-02-23T02:12:14.311520+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.16/lib/active_support/callbacks.rb:405:in `__run_callback’ 2014-02-23T02:12:14.311520+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/mongoid-3.1.6/lib/mongoid/contextual.rb:19:in `first’ 2014-02-23T02:12:14.311698+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.16/lib/action_controller/metal/rescue.rb:29:in `process_action’ […]

如何在rails app的内存中分析生产ruby

我的Ruby on Rails应用程序在Heroku上运行,其dyno具有512兆字节的RAM。 它正在使用几乎所有的RAM从应用程序启动,它只会从那里变得更糟。 我没有在启动时从数据库加载大量数据,所以不明白它为什么要使用这么多内存。 如何在生产中分析我的应用程序,以便了解内存使用的来源? 我知道我可以选择添加另一个dyno或增加dyno内存,但我想先了解发生了什么。