Tag: heroku

Ruby on Rails – 无法加载这样的文件 – mysql2 / 2.2 / mysql2(LoadError)

我在我的Rails项目中使用SQLite,但当我听说Heroku不支持SQLite时,我转而使用MYSQL。 切换我的数据库后,我启动了我的rails服务器“rails s”,但它给了我以下错误: C:\Sites\simple_cms>rails server C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/mysql2-0.3.18-x64-mingw32/lib/mysql2/mysql2.rb:2:in `require’ : cannot load such file — mysql2/2.2/mysql2 (LoadError) from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/mysql2-0.3.18-x64-mingw32/lib/mysql2/mysql2.rb:2 :in `’ from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/mysql2-0.3.18-x64-mingw32/lib/mysql2.rb:31:in `r equire’ from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/mysql2-0.3.18-x64-mingw32/lib/mysql2.rb:31:in `’ from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.8.4/lib/bundler/runtime.rb:76:in `requ ire’ from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.8.4/lib/bundler/runtime.rb:76:in `bloc k (2 levels) in require’ from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.8.4/lib/bundler/runtime.rb:72:in `each ‘ from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.8.4/lib/bundler/runtime.rb:72:in `bloc k in require’ from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.8.4/lib/bundler/runtime.rb:61:in `each ‘ from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.8.4/lib/bundler/runtime.rb:61:in `requ […]

安装sqlite3时发生导轨应用程序错误导致Heroku错误,并且Bundler无法继续

我试图将我的rails应用程序推送到heroku并收到如下错误: – Counting objects: 177, done. Delta compression using up to 2 threads. Compressing objects: 100% (161/161), done. Writing objects: 100% (177/177), 44.73 KiB, done. Total 177 (delta 39), reused 0 (delta 0) —–> Heroku receiving push —–> Ruby/Rails app detected —–> Installing dependencies using Bundler version 1.2.1 Running: bundle install –without development:test –path vendor/bundle […]

Heroku:保存缓存时遇到错误

一切都在当地工作正常,但推到Heroku时: Warning. Error encountered while saving cache /tmp/build_1b5c442a-d24e-4f80-9755-a0bd15d7f029/tmp/cache/sass/bc1b787c8640c68bf42fc69efbef227d36428060/_carousel.scssc: can’t dump anonymous class # Warning. Error encountered while saving cache /tmp/build_1b5c442a-d24e-4f80-9755-a0bd15d7f029/tmp/cache/sass/bc1b787c8640c68bf42fc69efbef227d36428060/_hero-unit.scssc: can’t dump anonymous class # Warning. Error encountered while saving cache /tmp/build_1b5c442a-d24e-4f80-9755-a0bd15d7f029/tmp/cache/sass/bc1b787c8640c68bf42fc69efbef227d36428060/_utilities.scssc: can’t dump anonymous class # Warning. Error encountered while saving cache /tmp/build_1b5c442a-d24e-4f80-9755-a0bd15d7f029/tmp/cache/sass/5b1569a9810eac207f22942f2921f0820863a2d6/exams.css.scssc: can’t dump anonymous class # Warning. Error encountered while saving cache […]

Heroku上的Rails 3 SSL

我目前正在开发Rails 3.0.9中的电子商务应用程序,它在Heroku上托管。 理想情况下,我想设置“基于主机名的SSL”(http://addons.heroku.com/ssl),但Heroku收取每月20美元的费用,这对我来说现在看起来有点陡峭。 Heroku通过搭载证书提供免费的SSL解决方案,但您必须使用他们的域名(https://yourapp.heroku.com) 我想我会将我的付款页面指向此URL,然后在处理完交易后将用户重定向回我的自定义URL。 我使用此解决方案时遇到的问题是: 在事务之后将用户重定向回自定义URL时,我的flash消息将不会显示,因为它与heroku URL的cookie绑定。 如何将Flash消息发送回自定义域? 如果用户点击付款页面上的任何菜单链接,它们将被发送到Heroku URL上托管的页面。 由于我的所有链接都与根域相关。 是否有一种方法可以强制生成所有生成的URL(我在菜单中使用’url_for’链接)来使用完整的自定义域名url? 除非有人可以完全建议替代解决方案? 谢谢

使用Paperclip和AWS上传大文件时出错

Heroku上的我的rails应用程序允许用户使用回形针上传照片以存储在amazon web servicesS3上。 当照片的大小超过1.5MB时,应用程序似乎超时了。 解决这个问题的最佳方法是什么? 如果有帮助,这是堆栈跟踪? E, [2013-10-07T14:15:57.018396 #5] ERROR — : /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/static.rb:62:in `call’ 2013-10-07T14:15:57.018974+00:00 app[web.2]: E, [2013-10-07T14:15:57.018430 #5] ERROR — : /app/vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in `forward’ 2013-10-07T14:15:57.018974+00:00 app[web.2]: E, [2013-10-07T14:15:57.018772 #5] ERROR — : /app/vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:143:in `pass’ 2013-10-07T14:15:57.018974+00:00 app[web.2]: E, [2013-10-07T14:15:57.018946 #5] ERROR — : /app/vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:71:in `call!’ 2013-10-07T14:15:57.019152+00:00 app[web.2]: E, [2013-10-07T14:15:57.018983 #5] ERROR — : /app/vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in `call’ 2013-10-07T14:15:57.019152+00:00 […]

代码推送到heroku不工作

我想在gihub上的heroku上推送代码 我使用了以下命令 git push heroku mybranch:master 错误是 To https://github.com/user/lyricle-new.git ! [rejected] lyricle-frt-backend -> master (non-fast-forward) error: failed to push some refs to ‘https://github.com/user/app.git’ hint: Updates were rejected because a pushed branch tip is behind its remote hint: counterpart. Check out this branch and merge the remote changes hint: (eg ‘git pull’) before pushing again. hint: […]

无法在Heroku上部署Ruby on Rails应用程序?

我已经在Heroku上成功部署了Ruby on Rails应用程序。 但是,当我访问Heroku提供的URL时,错误说:“您要查找的页面不存在。” url – https://cryptic-waters-2558.herokuapp.com/ 请帮忙。

Heroku Scheduler:CreditsController的未定义局部变量或方法`params’:Class

我正在尝试使用Heroku Scheduler自动执行任务。 我在本地测试了这个任务并且它有效。 我创建了一个临时路线进行测试,每当我点击路线时它都有效: get ‘create_expired_credit_lines’ to: ‘credits#create_expired_lines’ credits.controller.rb class CreditsController < ApplicationController … def self.create_expired_lines … @new_credit = Credit.new(params[:credit]) … end 然后我创建了一个文件 app/lib/tasks/scheduler.rake desc “This task is called by the Heroku scheduler add-on” task :create_expired_credit_lines => :environment do puts “Creating expired credit lines…” CreditsController.create_expired_lines puts “done.” end 当任务执行时,我收到以下错误: 2014-03-20T21:42:11.190318+00:00 app[scheduler.4496]: undefined local variable or […]

在heroku上实现邪恶的pdf的问题

我正在使用本指南在heroku上集成wicked_pdf。 但不知何故它似乎没有用。 我从heroku获得了日志,它说: Processing PdfController#get_pdf to pdf (for 115.248.175.50 at 2011-02-15 23:54:44) [GET] Parameters: {“format”=>”pdf”, “action”=>”get_pdf”, “id”=>”1”, “controller”=>”pdf”} ***************WICKED*************** Rendering pdf/get_pdf RuntimeError (PDF could not be generated! /usr/ruby1.8.7/lib/ruby/1.8/open3.rb:73:in `exec’: No such file or directory – /app/fa369291-829b-4b61-9efe-b2f0d0a0a42c/home/bin/wkhtmltopdf-amd64 – – (Errno::ENOENT) from /usr/ruby1.8.7/lib/ruby/1.8/open3.rb:73:in `popen3′ from /usr/ruby1.8.7/lib/ruby/1.8/open3.rb:59:in `fork’ from /usr/ruby1.8.7/lib/ruby/1.8/open3.rb:59:in `popen3′ from /usr/ruby1.8.7/lib/ruby/1.8/open3.rb:57:in `fork’ from /usr/ruby1.8.7/lib/ruby/1.8/open3.rb:57:in `popen3′ from […]

由于sqlite3 gem错误,Heroku部署失败

我刚刚开始阅读Michael Hartl撰写的ruby.railstutorial.org书,并一直在完成第一章。 我正在使用mac book OS X,Terminal和Sublime Text。 一切都按计划进行,直到测试部署到Heroku为止。 我能够连接到Heroku并运行$ git push heroku master命令。 但部署失败: Installing sqlite3 (1.3.5) with native extensions Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. /usr/local/bin/ruby extconf.rb checking for sqlite3.h… no sqlite3.h is missing. Try ‘port install sqlite3 +universal’ or ‘yum install sqlite-devel’ and check your shared library search path (the location […]