Tag: heroku

重定向Heroku上的静态资源的子域

我希望myapp.com/blog重定向到www.myapp.com/blog。 我已经安装了Refraction来在Rack层进行子域重定向。 这对Heroku for / blog不起作用,因为我在/ blog中的文件是静态资产。 任何修复?

phusion乘客是否使用分叉,如果是,在哪里设置after_fork配置?

phusion乘客是否使用分叉? 如果是这样,我应该在哪里设置after_fork配置, 如Heroku对unicorn的建议 (re:使用Rails设置PostGIS)? 来自Heroku的文档: 此外,如果在重新建立连接的地方使用独角兽或任何其他进程分叉代码 ,请确保将适配器覆盖到postgis。 例如: # unicorn.rb after_fork do |server, worker| if defined?(ActiveRecord::Base) config = Rails.application.config.database_configuration[Rails.env] config[‘adapter’] = ‘postgis’ ActiveRecord::Base.establish_connection(config) end end

RoR2.8和Heroku:我安装了一个插件,在本地工作,现在heroku根本不起作用

heroku日志提出: ==> dyno-3334279.log (crash) <== /app/fd916ea6-bad5-440e-a560-405ef5e3beee/home/.bundle/gems/ruby/1.8/gems/searchlogic-2.4.19/lib/searchlogic/named_scopes/conditions.rb:81:in `method_missing': undefined method `has_attached_file' for # (NoMethodError) from /app/fd916ea6-bad5-440e-a560-405ef5e3beee/home/.bundle/gems/ruby/1.8/gems/searchlogic-2.4.19/lib/searchlogic/named_scopes/association_conditions.rb:19:in `method_missing’ from /app/fd916ea6-bad5-440e-a560-405ef5e3beee/home/.bundle/gems/ruby/1.8/gems/searchlogic-2.4.19/lib/searchlogic/named_scopes/association_ordering.rb:27:in `method_missing’ from /app/fd916ea6-bad5-440e-a560-405ef5e3beee/home/.bundle/gems/ruby/1.8/gems/searchlogic-2.4.19/lib/searchlogic/named_scopes/ordering.rb:30:in `method_missing’ from /app/fd916ea6-bad5-440e-a560-405ef5e3beee/home/.bundle/gems/ruby/1.8/gems/searchlogic-2.4.19/lib/searchlogic/named_scopes/or_conditions.rb:28:in `method_missing’ from /app/fd916ea6-bad5-440e-a560-405ef5e3beee/home/.bundle/gems/ruby/1.8/gems/activerecord-2.3.8/lib/active_record/base.rb:1994:in `method_missing’ from /app/fd916ea6-bad5-440e-a560-405ef5e3beee/home/app/models/ckeditor/attachment_file.rb:2 from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require’ from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require’ from /app/fd916ea6-bad5-440e-a560-405ef5e3beee/home/.bundle/gems/ruby/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:158:in `require’ from /app/fd916ea6-bad5-440e-a560-405ef5e3beee/home/.bundle/gems/ruby/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:265:in `require_or_load’ from /app/fd916ea6-bad5-440e-a560-405ef5e3beee/home/.bundle/gems/ruby/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:224:in `depend_on’ from /app/fd916ea6-bad5-440e-a560-405ef5e3beee/home/.bundle/gems/ruby/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:136:in `require_dependency’ from /app/fd916ea6-bad5-440e-a560-405ef5e3beee/home/.bundle/gems/ruby/1.8/gems/rails-2.3.8/lib/initializer.rb:414:in `load_application_classes’ from /app/fd916ea6-bad5-440e-a560-405ef5e3beee/home/.bundle/gems/ruby/1.8/gems/rails-2.3.8/lib/initializer.rb:413:in `each’ from […]

`parse_rackup_file’:rackup文件(config.ru)不可读(ArgumentError)

我的proc文件中有这个“web:bundle exec unicorn -p $ PORT -c ./config/unicorn.rb”。 启动服务器后,我收到以下错误消息。 foreman start 12:29:20 web.1 | started with pid 4876 12:29:20 web.1 | exited with code 1 12:29:20 system | sending SIGTERM to all processes 12:29:20 | /home/stcadmin/.rvm/gems/ruby-1.9.3-p448@cpi2/gems/unicorn-4.7.0/lib/unicorn/configurator.rb:659:in `parse_rackup_file’: rackup file (config.ru) not readable (ArgumentError) 12:29:20 | from /home/stcadmin/.rvm/gems/ruby-1.9.3-p448@cpi2/gems/unicorn-4.7.0/lib/unicorn/configurator.rb:77:in `reload’ 12:29:20 | from /home/stcadmin/.rvm/gems/ruby-1.9.3-p448@cpi2/gems/unicorn-4.7.0/lib/unicorn/configurator.rb:68:in `initialize’ 12:29:20 | […]

Heroku Rails Net :: HTTP:OpenSSL :: SSL :: SSLError:SSL_connect返回= 1 errno = 0状态= SSLv3读取服务器证书B:证书validation失败

我有一个在Heroku服务器上运行的Rails应用程序,我在通过HTTPS使用Net :: HTTP与外部服务器通信时遇到问题。 每当我尝试通过HTTPS POST到外部专有API时,我收到的错误是: OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed 我已经花了几个小时谷歌搜索我遇到的问题的答案,但无济于事。 这是我的环境: Heroku Dyno运行Cedar 14(运行Cedar 10,升级到Cedar 14,看它是否会影响问题 – 没有快乐) Rails 3.2.14rc2 Ruby 2.1.2 “修复”我尝试过: 运行certified gem (实际上似乎有助于通过Omniauth和Google的API进行通信) Monkey-patch从validation方法列表中删除SSLv2,SSLv3 。 当我在Heroku的服务器上的控制台中尝试这个时,它似乎对GET方法运行良好,但在尝试运行Net::HTTP::Post.new而不是Net::HTTP::Get.new时,似乎完全忽略调整Net::HTTP::Get.new 手动覆盖证书文件位置 。 我已经指定它使用操作系统的权限文件(在Cedar-14堆栈上是最新的),但仍然没有骰子。 我也试过手动指定在Net :: HTTP对象上使用ssl_version=”TLSv1_2″没有运气(它甚至报告了相同的SSLv3相关错误) 当在开发中本地运行时,通信似乎工作得很好(我已经使用了这里建议的RVM覆盖方法 ),但是当我在Heroku服务器上尝试时,我运气不好。 更新:即使使用RVM更新,它似乎也无法在本地运行。 最后,但并非最不重要的,这是我正在运行的代码的抽象变体: uri = URI.parse(“https://api.mysite.com/api/v1”) http = Net::HTTP.new(uri.host, uri.port) http.use_ssl […]

用Rails推送Heroku Master错误

当我尝试git push heroku master命令时,我收到以下错误: matt@matt-desktop:~/Documents/Ruby/rails_projects/ninja_speak_app$ git push heroku master To https://git.heroku.com/limitless-inlet-4477.git ! [rejected] master -> master (fetch first) error: failed to push some refs to ‘https://git.heroku.com/limitless-inlet-4477.git’ hint: Updates were rejected because the remote contains work that you do hint: not have locally. This is usually caused by another repository pushing hint: to the same ref. […]

为什么dropdown-toggle(bootstrap)在heroku上不起作用?

我不明白为什么我视图中的以下代码(标题栏)在heroku上不起作用。 它似乎在我的本地服务器上的开发和生产上都能正常工作。 一旦我推送到heroku,生成的HTML也很好。 所有其他bootstrap元素似乎都有效。 但是,此下拉链接似乎不起作用 Account 生成的HTML: Account Profile Settings Sign out 我的app / assets / stylesheets / application.css * = require custom 我的app / assets / stylesheets / custom.css.scss @import “bootstrap”; 我对heroku很新。 所以我不知道如何调试这样的错误。 如何解决我如何调试这样的错误?

Heroku上的ffmpeg:无法识别的选项’预设’

我在我的本地Rails应用程序中使用ffmpeg版本1.2.4来转换video文件。 当我在本地运行应用程序时,一切都按预期工作。 当我部署到heroku时,我为ffmpeg添加了一个buildpack: https://github.com/shunjikonishi/heroku-buildpack-ffmpeg 这将安装ffmpeg版本git-2013-06-02-5711e4f。 当我尝试将video转码为mp4时,出现以下错误: 无法识别的选项’预设’。 拆分参数列表时出错:找不到选项 这是完整的日志: 2013-11-17T19:45:05.255059+00:00 app[web.1]: Running transcoding… 2013-11-17T19:45:05.255059+00:00 app[web.1]: ffmpeg -y -i /app/public/uploads/tmp/1384717504-2-9158/Untitled.mov -vcodec libx264 -acodec libfaac -s 640×360 -qscale 0 -preset slow -g 30 -aspect 1.7777777777777777 /app/public/uploads/tmp/1384717504-2-9158/tmpfile.mp4 2013-11-17T19:45:05.255059+00:00 app[web.1]: 2013-11-17T19:45:05.317895+00:00 app[web.1]: Failed encoding… 2013-11-17T19:45:05.317895+00:00 app[web.1]: ffmpeg -y -i /app/public/uploads/tmp/1384717504-2-9158/Untitled.mov -vcodec libx264 -acodec libfaac -s 640×360 -qscale 0 -preset […]

在本地mysql数据库中提取mysql数据库时出错

我试图将heroku mysql数据库拉入我的本地mysql数据库,但它给了我一些错误。 我已经在github上发布了这个问题。 这是我在github上发布的问题。 我还发布了错误日志。 请帮我解决这个问题。 有没有其他方法可以将heroku数据库导入我的本地数据库..? 我也试图通过chunksize获取数据,但它只获取60%到70%的数据,之后它会产生相同的错误。

Rails 4自定义404导致Heroku上的postgresql连接失败

我在生产中使用自定义域部署了一个Rails 4应用程序。 我也有一个升级版本。 该应用程序使用舒适的墨西哥沙发。 出现以下问题:应用程序将达到所有请求返回500错误的状态。 日志显示: [jesse@Athens expat]$ heroku logs ActiveRecord::ConnectionTimeoutError (could not obtain a database connection within 5.000 seconds (waited 5.000 seconds)): [jesse@Athens expat]$ heroku pg:info Connections: 5 [jesse@Athens expat]$ heroku pg:ps pid | state | source | running_for | waiting | query —–+——-+——–+————-+———+——- (0 rows) [jesse@Athens expat]$ heroku pg:killall pg_terminate_backend ———————- t t […]