Tag: heroku

Heroku部署Gemfile.lock问题

我对整个部署事情都很陌生。 在我第一次创建应用程序之前,我已经部署了一次应用程序,然后一切似乎都运行正常。 我现在对我的应用程序进行了一些更改,我想部署它们并确保它们在生产环境中工作。 我添加并提交了我的最后一项更改,并将我的更改合并到我的主分支中。 然后我跑了git push heroku master 。 我在输出中收到以下错误: Gemfile detected, running Bundler version 1.0.7 Unresolved dependencies detected; Installing… Using –without development:test You have modified your Gemfile in development but did not check the resulting snapshot (Gemfile.lock) into version control 好的,所以我需要更新我的gemfile。 首先,我检查了我的.gitignore文件的内容,它们是: .bundle db/*.sqlite3* log/*.log *.log /tmp/ doc/ *.swp *~ .project .DS_Store .psd Gemfile.lock似乎不在那里,但无论如何我尝试了以下内容: […]

user first_name last_name字段用于创建full_name字段

我的rails中有我的模型中当前表示的first_name和last_name字段。 我想在我的数据库中添加另一个名为full_name字段,并想知道无缝地执行此操作的最佳方法是什么。 请注意,我还有一个生产服务器,并希望这样做,以便我不仅在迁移中添加一列,而且还可以使用现有数据填充新字段。 编辑: 这是我的控制器 def followers @title = “Followers” @user = User.find(params[:id]) @users = @user.followers.paginate(page: params[:page]) @followers = @user.followers.find(:all, :select => ‘users.id, users.first_name, users.last_name’, :conditions => [“users.first_name like ?”,”%” + params[:q] + “%”]) respond_to do |format| format.html {render ‘show_follow’} format.json {render :json => @followers} end end 我希望能够1. select: ‘users.id, users.full_name和select: ‘users.id, users.full_name :condition =>[“users.full_name […]

部署到heroku时,与fontawesome的Rails编译器错误

当我尝试将我的Rails项目推送到Heroku时收到错误消息。 我正在使用Fontawesome,它在当地环境中完美运行,但不会推送到Heroku。 Running: rake assets:precompile I, [2016-03-22T05:59:25.096354 #366] INFO — : Writing /tmp/build_3e31f1bb8b828cb787890706e9ec589b/public/assets/FontAwesome-0d34da07e5cbcb4ff087b397966a9f9ffb4d6ed7c7060568565203c02f3fee11.otf I, [2016-03-22T05:59:25.099701 #366] INFO — : Writing /tmp/build_3e31f1bb8b828cb787890706e9ec589b/public/assets/fontawesome-webfont-e511891d3e01b0b27aed51a219ced5119e2c3d0460465af8242e9bff4cb61b77.eot rake aborted! Sass::SyntaxError: Invalid CSS after “…orm-group::not(“: expected pseudo_expr, was “:first-child)” (sass):9108 /tmp/build_3e31f1bb8b828cb787890706e9ec589b/vendor/bundle/ruby/2.2.0/gems/sprockets-rails-3.0.4/lib/sprockets/rails/task.rb:67:in block (2 levels) in define’ Tasks: TOP => assets:precompile (See full trace by running task with –trace) ! ! Precompiling assets […]

需要API签名才能向PayPal发出错误请求,我已经有了一个API签名集

我现在遇到了很大的问题。 我的网站是用Ruby on Rails编写的,我正在使用活跃的商家gem来与PayPal进行交互。 该网站托管在heroku上。 我在我的heroku应用程序中将API密钥和API签名设置为配置变量。 但是,我仍然得到错误: Running: rake assets:precompile (in /tmp/build_3pvaswdp7wvca1) rake aborted! An API Certificate or API Signature is required to make requests to PayPal (See full trace by running task with –trace) 我可以运行heroku运行rake资产:单独预编译,并且完全正常。 此外,我的暂存站点在我的暂存站点上设置了完全相同的配置变量(RACK_ENV和RAILS_ENV设置为临时站点btw上的生产),这似乎工作正常。 但是,我的生产网站崩溃了。 关于可能发生的事情/如何解决这个问题的任何想法?

如何在heroku上重定向域?

我有一个专为stuff.heroku.com上的多个用户设计的应用程序 登录页面可能看起来像stuff.heroku.com/controller/1/action/73 但是我想在那里重定向的url看起来像sub.domain.com/hello 同样,我可能希望sub.domain.com/greetings指向另一个登录页面,这次是在stuff.heroku.com/controller/1/action/74。 一旦有效,我会希望sub.anotherdomain.com/hello映射回我的同一个应用程序,例如stuff.heroku.com/controller/1/action/87 我怎样才能做到这一点?

如何在Heroku上使用postgres扩展? 以及如何处理他们的迁移?

我有一个包含pg_search和queue_classic gems的Rails应用程序。 这两个都使用PostgreSQL扩展,例如unaccent,pg_trgm和ps-something-something(对不起,不是我的开发机器,不记得了)。 我正在部署到Heroku,并且无法运行超出这些扩展的迁移 例如, def up execute “create extension unaccent” execute “create extension pg_trgm” end 我得到的印象是Heroku从这里支持这些https://devcenter.heroku.com/articles/full-text-search以及Heroku使用queue_classic https://github.com/ryandotsmith/queue_classic这一事实。 我一直无法找到任何解释如何在Heroku上使用这些postgres扩展的信息。 或者即使它们可用于共享数据库或仅用于专用数据库。 所以我的问题: 如何在Heroku上为我的应用程序提供这些扩展? 如何处理迁移,以便这些扩展可用于开发和测试环境,但如果Heroku限制此类执行,则不会破坏登台或生产或环境上的迁移。 真的很感激任何想法,特别是那些伴随相关信息/指示的指示。 谢谢

Heroku Gem安装后无法正常工作

我想在Ubuntu 9.10上运行heroku 我打字了 sudo gem install heroku 一切正常,但是当我去跑步时: heroku list 我明白了 heroku:命令未找到

使用外部SMTP在Heroku上发送电子邮件

我想从Heroku上的rails应用程序发送电子邮件。 由于Heroku不支持SMTP,我使用外部SMTP服务器。 config / environments / production.rb具有以下行。 ActionMailer::Base.delivery_method = :smtp ActionMailer::Base.smtp_settings = { :address => ‘mydomain.com’, :port => 587, :user_name => “myusername”, :password => “password”, :authentication => :plain, :enable_starttls_auto => true, :openssl_verify_mode => ‘none’ } 当我从“heroku运行控制台”发送电子邮件时,它工作正常。 但它不会从网站发送电子邮件。 奇怪的是,“heroku logs –tail”显示“已发送邮件给…”。 实际上电子邮件没有发送。 有没有人对这个问题有任何想法? 谢谢。 山姆孔

获取错误:在部署/迁移到Heroku时更新rubygems

迁移到Heroku时出现以下错误。 Installing hoe (2.9.4) /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/installer.rb:170:in > install’:hoe需要RubyGems版本> = 1.4。 尝试’gem update –system’来更新RubyGems本身。 (gem:: InstallError)` 这就是rubygem版已经过时了。 有人知道我怎么能解决这个问题? 使用rails 3.0.5和ruby 1.9.2 bundler Using rake (0.8.7) Using RedCloth (4.2.2) Using abstract (1.0.0) Using activesupport (3.0.5) Using builder (2.1.2) Using i18n (0.5.0) Using activemodel (3.0.5) Using erubis (2.6.6) Using rack (1.2.2) Using rack-mount (0.6.14) Using rack-test (0.5.7) Using tzinfo […]

Heroku – 页面不存在

尝试访问我的应用程序时出现错误,表明我的页面不存在。 它在本地工作,但不在系统上,我已经运行rake和路由并重新启动,没有决心。 “页面不存在”存在确实显示我的自定义图标。 这是一个简单的单页应用程序,供我个人公司使用,我自己,非常基本,没有顶部,一套脚手架,这就是它….在RubyMine中开发 路线文件: BoothLeads::Application.routes.draw do resources :leads # The priority is based upon order of creation: # first created -> highest priority. # Sample of regular route: # match ‘products/:id’ => ‘catalog#view’ # Keep in mind you can assign values other than :controller and :action # Sample of named route: # match ‘products/:id/purchase’ […]