Tag: heroku

捆绑exec与heroku – 是否有必要?

我最近在Heroku上设置了一个Cedar(Rails 3.1)应用程序,并且运行,例如,迁移,你会做 heroku run rake db:migrate 我了解到在任何rake命令之前使用“bundle exec”是一个好习惯(正如Katz所说http://yehudakatz.com/ )。 所以,我想也许以下实际上是更好的做法: heroku run bundle exec rake db:migrate 但是为了减少冗长,是否可以使用前一个命令,或者是bundle exec批判的那个?

Rails 3迁移:boolean(mysql vs postgreSQL)

我正在尝试在论坛主题上添加“粘性”选项。 这就是我的迁移的样子 def self.up add_column :topics, :sticky, :boolean, :null => false, :default => false end def self.down remove_column :topics, :sticky end 这在mysql上本地完美,但是当我将更改推送到heroku(使用PostgreSQL)时,这就是我在使用控制台时所获得的 >> t.sticky => “f” >> t.sticky.class => String >> t.sticky = true => true >> t.sticky.class => TrueClass 为什么这个属性的默认值是String? 编辑:如果我保存对象,它不会改变粘性属性,即它仍然是“f”。

如何使用Rails代理解析URL?

我的应用程序具有以下控制器操作: def test #get URL url = “http://www.coteur.com/surebet.php” doc = Nokogiri::HTML(open(url)) @show = doc.at_css(“title”).text @game_data = Array.new doc.css(‘tbody’).each do |tr| tr.css(“tr”).each do |f| @game_data.push(f.css(“td”).text) end end end 并呈现以下视图: Nope 一切都在本地工作正常,但在Heroku上, 似乎是空的,而不应该是。 问题是在美国它不起作用,但在欧盟它确实有效。 那么我如何使用代理或更改服务器位置或其他方式来解决这个问题呢?

rake资产:预编译中止,无法推送到heroku

我正在使用Enki博客gem,它在本地工作,试图准备推送到heroku(从来没有遇到过问题)。 我试图预编译,它做到了这一点 /Users/me/.rvm/rubies/ruby-1.9.3-rc1/bin/ruby /Users/me/.rvm/gems/ruby-1.9.3-rc1@ruby193/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets rake aborted! cannot load such file — uglifier (in /Users/me/Sites/bayani/app/assets/javascripts/admin.js) 我以前从未遇到过将Enki博客推向Heroku的麻烦,虽然我不知道uglifier在哪里,但我记得曾在其他Enki博客中看过它,所以我不知道为什么它现在会产生问题。 当我推送到Heroku时它也中止了预编译 Preparing app for Rails asset pipeline Running: rake assets:precompile rake aborted! no such file to load — uglifier (in /tmp/build_5tbsi7k7ddhk/app/assets/javascripts/admin.js) Tasks: TOP => assets:precompile:primary (See full trace by running task with –trace) Precompiling assets failed, enabling […]

如何在Heroku上的rails应用程序上完全关闭资产编译?

我有一个rails应用程序,它运行没有资产的服务。 当我部署时,我看到: —–> Preparing app for Rails asset pipeline Running: rake assets:precompile rake aborted! could not connect to server: Connection refused Is the server running on host “127.0.0.1” and accepting TCP/IP connections on port 5432? /tmp/build_3pneyggcg60ks/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/postgresql_adapter.rb:1222:in `initialize’ /tmp/build_3pneyggcg60ks/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/postgresql_adapter.rb:1222:in `new’ /tmp/build_3pneyggcg60ks/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/postgresql_adapter.rb:1222:in `connect’ … 所以我把它放到我的application.rb中: config.assets.enabled = false config.serve_static_assets = false config.assets.compile = false 但是在部署时我仍然会收到相同的消息。 如何在heroku上完全关闭资产编译/处理?

Rails 3.1 Sqlite3错误推送到Heroku

我有一个rails 3.1应用程序,我试图推送到Heroku。 当我推动它时它会一直失败。 Installing sqlite3 (1.3.4) with native extensions Unfortunately, a fatal error has occurred. Please report this error to the Bundler issue tracker at https://github.com/carlhuda/bundler/issues so that we can fix it. Thanks! /usr/local/lib/ruby/1.9.1/rubygems/installer.rb:483:in `rescue in block in build_extensions’: ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError) /usr/local/bin/ruby extconf.rb checking for sqlite3.h… no sqlite3.h is […]

Active Admin Gem – Rails 3.2.3,Heroku错误日志

我在理解错误日志时遇到问题。 我正在使用Active Admin,一切都在我的本地服务器上运行良好但是当我推送到Heroku时我无法登录或使用活动管理员。 关于问题是什么,我有点困惑。 我妻子的前端工作,但当我第一次尝试登录时,我收到此错误。 我跑了 heroku run rake db:migrate application.rb中 config.assets.initialize_on_precompile = false 的routes.rb break if ARGV.join.include? ‘assets:precompile’ Heroku记录 2012-06-01T06:11:53+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/action_controller/metal/responder.rb:153:in `respond’ 2012-06-01T06:11:53+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/action_controller/metal/responder.rb:146:in `call’ 2012-06-01T06:11:53+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/action_controller/metal/mime_responds.rb:239:in `respond_with’ 2012-06-01T06:11:53+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/devise-2.1.0/app/controllers/devise/sessions_controller.rb:9:in `new’ 2012-06-01T06:11:53+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/action_controller/metal/implicit_render.rb:4:in `send_action’ 2012-06-01T06:11:53+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/abstract_controller/base.rb:167:in `process_action’ 2012-06-01T06:11:53+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/abstract_controller/callbacks.rb:18:in `block in process_action’ 2012-06-01T06:11:53+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/action_controller/metal/rendering.rb:10:in `process_action’ 2012-06-01T06:11:53+00:00 […]

heroku db:使用点击gem推不工作

我在dev上使用gem ‘sqlite3’, ‘1.3.5’ gem ‘pg’, ‘0.12.2’在prod上使用gem ‘pg’, ‘0.12.2’ 。 ruby version ruby 1.9.3p125 (2012-02-16) [i386-mingw32] 正在开发的教程应用程序。 我安装了taps gem并尝试了heroku db:push, 这就是我得到的。 HTTP CODE: 500 Taps Server Error: PGError: ERROR: time zone displacement out of range: “2012-0 5-06 12:00:00.000000+5894529600” 这也是heroku日志 。 解决办法是什么? 仅供参考:db:pull非常有效。 我还检查了其他类似的post,但到目前为止我找不到任何一个解决方案

Rails 3.1 Asset Pipeline – 关闭Heroku上的图像资产指纹识别?

因为我在我的应用程序中使用的jQuery插件直接引用了图像,所以我试图关闭资产指纹识别。 所以我在我的production.rb中设置了config.assets.digest = false ,但现在我的图像引用都没有。 /assets/foo.png只返回一个空白响应。 我真的不想改变jQuery插件的代码并添加erb图像助手,但我不知道还能做什么。 坦率地说,图像的资产指纹识别似乎比它的价值要麻烦得多。 有人有任何见解吗? 谢谢!

加载到Heroku时Carrierwave / fog / AWS问题“无法加载此类文件 – 雾”

所以我是一个新手,并通过Michael Hartl的rails教程。 在尝试使用carrierwave,fog-aws为S3 AWS配置图片上传时,我变得完全陷入困境。 当推送到heroku时,我收到以下错误: LoadError:无法加载此类文件 – 雾 作为旁注,我尝试在开发模式中使用完全相同的代码,rails服务器工作正常,我能够成功上传文件到AWS。 因此,这不是AWS的配置设置问题。 尝试将应用程序推送到Heroku时出现问题。 这是我的设置: gemfile source ‘https://rubygems.org’ gem ‘rails’, ‘5.1.4’ gem ‘bcrypt’, git: ‘https://github.com/codahale/bcrypt-ruby.git’, :require => ‘bcrypt’ gem ‘faker’, ‘1.7.3’ gem ‘carrierwave’, ‘1.0.0’ gem ‘fog-aws’, ‘2.0.0’ gem ‘mini_magick’, ‘4.7.0’ gem ‘nokogiri’, ‘1.8.1’ gem ‘will_paginate’, ‘3.1.6’ gem ‘bootstrap-will_paginate’, ‘1.0.0’ gem ‘bootstrap-sass’, ‘3.3.7’ gem ‘puma’, ‘3.9.1’ gem ‘sass-rails’, ‘5.0.6’ […]