Heroku的首次Heroku推送导致应用程序错误 [英] First Heroku Push of Application to Heroku leads to Application Error

查看:293
本文介绍了Heroku的首次Heroku推送导致应用程序错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Heroku和Rails比较陌生。我已经推出了一个小的应用程序Heroku之前,工作得很好。



现在我在桌面电脑上开发了一个更大的应用程序,它使用我的rails服务器作为本地主机运行良好。



当我尝试将其迁移到Heroku时,我收到以下消息:

 应用程序错误
== ===============

应用程序发生错误,您的页面无法投放。请稍后重试。

如果您是应用程序所有者,请查看您的日志以了解详细信息。

我开始查看日志文件,但他们没有真正告诉我任何事情。有人可以给我一个关于如何解释它们的暗示。我认为最后一条日志文件行会导致应用程序崩溃:

  2013-08-12T17:54:56.944875 + 00 :00 app [web.1]:/app/vendor/bundle/ruby/2.0.0/gems/bundler-1.3.2/lib/bundler/rubygems_integration.rb:224:in`block in replace_gem':can not激活bcrypt-ruby(〜> 3.0.0),已经激活了bcrypt-ruby-3.1.1。确保所有的依赖关系都被添加到Gemfile中。 (Gem :: LoadError)

编辑:我现在添加了完整的'heroku日志'提示输出。有关寻找什么的任何建议。我对日志输出很不熟悉,不知道从哪里开始。

编辑2:感谢所有帮助远!我现在有应用程序工作。以下是问题



在我的Gem文件中,我将ByCrypt链接成这样:

  gem'bcrypt-ruby',:require => 'bcrypt'

由于Heroku日志说了一些关于

 无法激活bcrypt-ruby(〜> 3.0.0),已激活bcrypt-ruby-3.1.1。 

我将Gemfile更改为

  gem'bcrypt-ruby','〜> 3.0.0'

这有帮助!该应用程序现在在heroku上运行。但是我认为我现在对使用bcrypt的方法有问题......但我将不得不单独进行调查。感谢您的帮助!

解决方案

您是否已经迁移了数据库?



像这样:heroku run rake db:migrate



如果这个dosn't工作使用这个:



运行heroku日志,并粘贴日志在这里



2013-08-12T17:54:56.944875 + 00:00 app [web.1]:/ app / vendor / bundle / ruby / 2.0.0 / gems / bundler-1.3.2 / lib / bundler / ruby​​gems_integration.rb:224:in`block in replace_gem':无法激活bcrypt-ruby(〜> 3.0.0),已激活bcrypt-红宝石3.1.1。确保所有
依赖项都被添加到Gemfile中。 (Gem :: LoadError)



也许你忘了在gemfile中添加一个gem explicity,


I am relatively new to Heroku and Rails. I have pushed a small "app" to Heroku before which worked fine.

Now I have developed a bit of a larger application on my desktop pc, which runs fine using my rails server as localhost.

When I try migrating it to Heroku I get the following message:

   Application Error
   =================

   An error occurred in the application and your page could not be served. Please try again   in a few moments.

   If you are the application owner, check your logs for details.

I started looking at the log files, but they don't really tell me anything. Can someone please give me a hint on how to interpret them. I think the last to logfile lines are the ones that crash the application:

2013-08-12T17:54:56.944875+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/bundler-1.3.2/lib/bundler/rubygems_integration.rb:224:in `block in replace_gem': can't activate bcrypt-ruby (~> 3.0.0), already activated bcrypt-ruby-3.1.1. Make sure all dependencies are added to Gemfile. (Gem::LoadError)

EDIT: I've now added the complete 'heroku logs' prompt output. Any suggestions on what to look for. I'm very unfamiliar with the log output, don't really know where to start.

EDIT 2: Thanks for all the help so far! I've got the app working now. The following was the problem

In my gem file I had ByCrypt linked in like this:

gem 'bcrypt-ruby', :require => 'bcrypt'

Since the Heroku logs said something about

can't activate bcrypt-ruby (~> 3.0.0), already activated bcrypt-ruby-3.1.1.

I changed my Gemfile to

gem 'bcrypt-ruby', '~> 3.0.0'

This helped! The app is now running on heroku. But I think I now have a problem with the methods using bcrypt... but I will have to investigate this seperately. Thanks for the help!

解决方案

have you migrated the database?

like this: heroku run rake db:migrate

if that dosn't work use this:

run heroku logs, and paste the log here

2013-08-12T17:54:56.944875+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/bundler-1.3.2/lib/bundler/rubygems_integration.rb:224:in `block in replace_gem': can't activate bcrypt-ruby (~> 3.0.0), already activated bcrypt-ruby-3.1.1. Make sure all dependencies are added to Gemfile. (Gem::LoadError)

maybe you forgot to add a gem explicity in your gemfile,

这篇关于Heroku的首次Heroku推送导致应用程序错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆