Rails应用程序不能在AWS弹性魔豆运行,sqlite3的错误 [英] Rails app doesn't run on AWS Elastic Beanstalk, sqlite3 error

查看:257
本文介绍了Rails应用程序不能在AWS弹性魔豆运行,sqlite3的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在努力,开始使用AWS的弹性魔豆运行Rails的,但我已经运行在一个看似不可逾越的障碍:虽然我能够旋转起来运行示例应用程序中的新的弹性魔豆,我似乎无法得到一个EB实例成功经营自己的code。

I have been trying to get started running Rails on AWS' Elastic Beanstalk, but I have run in to a seemingly insurmountable obstacle: While I am able to spin up a new Elastic Beanstalk running the sample application, I cannot seem to get an EB instance to successfully run my own code.

下面是我所采取的步骤:

Here are the steps I have taken:

  1. 在本地上OSX 10.9.3运行红宝石1.9.3p545
  2. 在安装AWS-EB客户端工具。
  3. 恪守遵循从亚马逊下面的教程:部署的Rails应用程序AWS弹性魔豆(TL; DNR:使用新轨道创建一个新的Rails应用程序,承诺的git,然后用EB初始化创造型亚马逊64位的Linux 2014.03 V1.0.3运行的EB实例红宝石1.9.3,然后运行EB开始')
  4. 在等待似乎永远要创建的EB实例后,我定位到URL Amazon提供。
  5. 而不是看到我的Rails应用程序(其中,顺便说一句,运行良好局部)中,我得到了可怕的很抱歉,但出事了页面:
  1. Locally running ruby 1.9.3p545 on OSX 10.9.3
  2. Installed aws-eb client tools.
  3. Scrupulously followed the following tutorial from Amazon: Deploying a Rails Application to AWS Elastic Beanstalk (tl;dnr: use 'rails new' to create a new rails app, commit to git and then use 'eb init' to create an EB instance of the type '64bit Amazon Linux 2014.03 v1.0.3 running Ruby 1.9.3' and then running 'eb start')
  4. After waiting a seeming eternity for the EB instance to be created, I navigate to the url Amazon provides.
  5. Instead of seeing my rails app (which, by the way, runs fine locally), I get the dreaded "We're sorry, but something went wrong" page:

我已经尝试这些步骤多次,具有相同的结果。我已经尝试使用不同的环境中尝试(使用Ruby 2.0.0彪马和乘客的,例如,通过在必要时RVM更新我的红宝石)。

I have tried these steps multiple times, with the same results. I have tried using different environments (the Ruby 2.0.0 Puma and Passenger ones, for instance, updating my ruby via rvm as necessary).

在这个标记为重复,请允许我直掉,我看着下面的问题,发现他们并没有解决我的问题:

Before this is flagged as a duplicate, let me state straight away that I have looked at the following questions and found that they have not solved my problem:

<一个href="http://stackoverflow.com/questions/19349971/aws-elastic-beanstalk-launching-a-new-rails-app">AWS弹性魔豆:启动一个新的Rails应用

<一个href="http://stackoverflow.com/questions/15672636/deploying-an-existing-rails-app-to-aws-elastic-beanstalk">Deploying现有的Rails应用到AWS弹性魔豆

继这个问题的意见AWS弹性魔豆:启动一个新的Rails应用程序,这似乎非常相似,我的问题,我让过夜的应用程序运行,我仍然得到错误

Following the advice in the question "AWS Elastic Beanstalk: Launching a new Rails App", which seems very similar to my issue, I let the app run over night and I am still getting the error.

我SSH方式登录到该实例。有趣的是,production.log和development.log显示为空(那些在/ var /应用程序/支持/日志,反正)。不过,我觉得在passenger.log如下:

I've ssh'd in to the instance. Interestingly, both production.log and development.log appear to be empty (the ones in /var/app/support/logs, anyway). However, I find the following in passenger.log:

***** 剪断 *****

[2014年6月12日21:42:38.8400 5133 / 7fe66aee4700代理商/ HelperAgent / RequestHandler.h 2210]:客户端20]无法结账会议。 错误页面: 无法加载这样的文件 - 的sqlite3 / sqlite3_native(LoadError)   /usr/local/share/gems1.9/gems/sqlite3-1.3.9/lib/sqlite3.rb:6:in 规定   /usr/local/share/gems1.9/gems/sqlite3-1.3.9/lib/sqlite3.rb:6:inrescue在'   /usr/local/share/gems1.9/gems/sqlite3-1.3.9/lib/sqlite3.rb:2:in &LT;顶(必填)&GT;   /usr/local/share/gems1.9/gems/bundler-1.6.2/lib/bundler/runtime.rb:76:inrequire   /usr/local/share/gems1.9/gems/bundler-1.6.2/lib/bundler/runtime.rb:76:in 块(2级)的要求   /usr/local/share/gems1.9/gems/bundler-1.6.2/lib/bundler/runtime.rb:72:ineach   在/usr/local/share/gems1.9/gems/bundler-1.6.2/lib/bundler/runtime.rb:72:in 块需要   /usr/local/share/gems1.9/gems/bundler-1.6.2/lib/bundler/runtime.rb:61:ineach   /usr/local/share/gems1.9/gems/bundler-1.6.2/lib/bundler/runtime.rb:61:in 规定   /usr/local/share/gems1.9/gems/bundler-1.6.2/lib/bundler.rb:132:inrequire   /var/app/current/config/application.rb:7:in &LT;顶(必填)&GT; /var/app/current/config/environment.rb:2:inrequire   /var/app/current/config/environment.rb:2:in &LT;顶(必填)&GT;   config.ru:3:inrequire   config.ru:3:in 阻止&lt;主&GT;   /usr/local/share/gems1.9/gems/rack-1.5.2/lib/rack/builder.rb:55:ininstance_eval   /usr/local/share/gems1.9/gems/rack-1.5.2/lib/rack/builder.rb:55:in 初始化   config.ru:1:innew   config.ru:1:in &lt;主&GT;   /usr/local/share/gems1.9/gems/passenger-4.0.41/helper-scripts/rack-$p$ploader.rb:112:ineval   /usr/local/share/gems1.9/gems/passenger-4.0.41/helper-scripts/rack-$p$ploader.rb:112:in preload_app   /usr/local/share/gems1.9/gems/passenger-4.0.41/helper-scripts/rack-$p$ploader.rb:158:in   /usr/local/share/gems1.9/gems/passenger-4.0.41/helper-scripts/rack-$p$ploader.rb:29:in &LT;模块:PhusionPassenger&GT;   /usr/local/share/gems1.9/gems/passenger-4.0.41/helper-scripts/rack-$p$ploader.rb:28:in

[ 2014-06-12 21:42:38.8400 5133/7fe66aee4700 agents/HelperAgent/RequestHandler.h:2210 ]: [Client 20] Cannot checkout session. Error page: cannot load such file -- sqlite3/sqlite3_native (LoadError) /usr/local/share/gems1.9/gems/sqlite3-1.3.9/lib/sqlite3.rb:6:in require' /usr/local/share/gems1.9/gems/sqlite3-1.3.9/lib/sqlite3.rb:6:inrescue in ' /usr/local/share/gems1.9/gems/sqlite3-1.3.9/lib/sqlite3.rb:2:in <top (required)>' /usr/local/share/gems1.9/gems/bundler-1.6.2/lib/bundler/runtime.rb:76:inrequire' /usr/local/share/gems1.9/gems/bundler-1.6.2/lib/bundler/runtime.rb:76:in block (2 levels) in require' /usr/local/share/gems1.9/gems/bundler-1.6.2/lib/bundler/runtime.rb:72:ineach' /usr/local/share/gems1.9/gems/bundler-1.6.2/lib/bundler/runtime.rb:72:in block in require' /usr/local/share/gems1.9/gems/bundler-1.6.2/lib/bundler/runtime.rb:61:ineach' /usr/local/share/gems1.9/gems/bundler-1.6.2/lib/bundler/runtime.rb:61:in require' /usr/local/share/gems1.9/gems/bundler-1.6.2/lib/bundler.rb:132:inrequire' /var/app/current/config/application.rb:7:in <top (required)>' /var/app/current/config/environment.rb:2:inrequire' /var/app/current/config/environment.rb:2:in <top (required)>' config.ru:3:inrequire' config.ru:3:in block in <main>' /usr/local/share/gems1.9/gems/rack-1.5.2/lib/rack/builder.rb:55:ininstance_eval' /usr/local/share/gems1.9/gems/rack-1.5.2/lib/rack/builder.rb:55:in initialize' config.ru:1:innew' config.ru:1:in <main>' /usr/local/share/gems1.9/gems/passenger-4.0.41/helper-scripts/rack-preloader.rb:112:ineval' /usr/local/share/gems1.9/gems/passenger-4.0.41/helper-scripts/rack-preloader.rb:112:in preload_app' /usr/local/share/gems1.9/gems/passenger-4.0.41/helper-scripts/rack-preloader.rb:158:in' /usr/local/share/gems1.9/gems/passenger-4.0.41/helper-scripts/rack-preloader.rb:29:in <module:PhusionPassenger>' /usr/local/share/gems1.9/gems/passenger-4.0.41/helper-scripts/rack-preloader.rb:28:in'

应用5241标准输出: 应用5241标准输出: [2014年6月12日21:45:26.2512 5133 / 7fe66d1ef700池2 / Implementation.cpp:883]:无法产卵过程组的/ var /应用/电流#默认:一个错误,而在启动日$发生      在无效Passenger::ApplicationPool2::SmartSpawner::handleErrorResponse(Passenger::ApplicationPool2::SmartSpawner::StartupDetails&)' (SmartSpawner.h:455)      在标准::字符串Passenger::ApplicationPool2::SmartSpawner::negotiate$p$ploaderStartup(Passenger::ApplicationPool2::SmartSpawner::StartupDetails&)' (SmartSpawner.h:566)      在空客:: ApplicationPool2 :: SmartSpawner ::开始preloader()(SmartSpawner.h:206)      在虚拟乘客:: ApplicationPool2 :: ProcessPtr客运:: ApplicationPool2 :: SmartSpawner ::重生(常量客运:: ApplicationPool2 ::选项和放大器;)(SmartSpawner.h:752)      在空客:: ApplicationPool2 ::组:: spawnThreadRealMain(常量客运:: ApplicationPool2 :: SpawnerPtr和放大器;,常量客运:: ApplicationPool2 ::选项和放大器;,无符号在$

App 5241 stdout: App 5241 stdout: [ 2014-06-12 21:45:26.2512 5133/7fe66d1ef700 Pool2/Implementation.cpp:883 ]: Could not spawn process for group /var/app/current#default: An error occured while starting up th$ in 'void Passenger::ApplicationPool2::SmartSpawner::handleErrorResponse(Passenger::ApplicationPool2::SmartSpawner::StartupDetails&)' (SmartSpawner.h:455) in 'std::string Passenger::ApplicationPool2::SmartSpawner::negotiatePreloaderStartup(Passenger::ApplicationPool2::SmartSpawner::StartupDetails&)' (SmartSpawner.h:566) in 'void Passenger::ApplicationPool2::SmartSpawner::startPreloader()' (SmartSpawner.h:206) in 'virtual Passenger::ApplicationPool2::ProcessPtr Passenger::ApplicationPool2::SmartSpawner::spawn(const Passenger::ApplicationPool2::Options&)' (SmartSpawner.h:752) in 'void Passenger::ApplicationPool2::Group::spawnThreadRealMain(const Passenger::ApplicationPool2::SpawnerPtr&, const Passenger::ApplicationPool2::Options&, unsigned in$

**** 结束剪断 ****

不知道如果sqlite3的是问题或没有,但它似乎是在实例安装。为以防万一,我又安装了sqlite3的宝石。

Not sure if sqlite3 is the problem or not, but it does appear to be installed on the instance. Just in case, I installed the sqlite3 gem again.

下面是乘客身份的输出:

Here is the output of passenger-status:

Version : 4.0.41
Date    : 2014-06-13 13:25:52 +0000
Instance: 5148
----------- General information -----------
Max pool size : 6
Processes     : 0
Requests in top-level queue : 0

----------- Application groups -----------
/var/app/current#default:
App root: /var/app/current
Requests in queue: 0

我不是专家,但它似乎是乘客没有运行(进程== 0)。

I'm no expert, but it seems like passenger isn't running (processes == 0).

我在想什么?有没有办法,我已经忘了设置为true一些JUST_WORK_DARNIT配置?

What am I missing? Is there some "JUST_WORK_DARNIT" config that I have neglected to set to true?

如果,事实上,有一个问题与sqlite3的安装,如建议如下,我能做些什么来解决这个问题?

If, in fact, there is an issue with the sqlite3 install, as is suggested below, what can I do to resolve the issue?

推荐答案

可以试图通过运行安装的sqlite-devel软件包百胜安装的sqlite-devel软件包

Can you try installing sqlite-devel by running yum install sqlite-devel?

您可能需要使用ebextensions亲自尝试,对豆茎。 尝试创建一个文件路径 .ebextensions /在你的应用程序源代码目录00-myfile.config 部署到豆茎之前。

You may want to use ebextensions to try this out on beanstalk. Try creating a file with path .ebextensions/00-myfile.config in your app source directory before deploying to beanstalk.

packages:
    yum:
        sqlite-devel: []

听起来类似于这里讨论的问题为什么我不能安装源码宝石?

让我知道,如果工程。

更新

还有就是使用Rails 4.也许你打这个问题上改变一件事。 看到这里讨论: https://github.com/rails/rails/pull/8468 由于上述变更由轨道4生成的默认示例应用程序不能在生产模式下工作。然而,你可以把它通过修改示例应用程序,包括非默认的网页的工作。

There is one thing that changed with Rails 4. Possibly you are hitting this issue. See the discussion here: https://github.com/rails/rails/pull/8468 The default sample app generated by rails 4 does not work in production mode because of the above change. You can however make it work by modifying the sample app to include a non-default web page.

我试过如下: 之后运行轨道的新应用程序的名字,混帐初始化,EB初始化尝试以下步骤。 (基于这个接听)。

I tried the following: After running "rails new appname", "git init", "eb init" try the following steps. (Based on this answer).

  1. 编辑配置/ routes.rb中,使其包含根:以=&GT; 原#指数
  2. 创建应用程序/控制器/ proto_controller.rb包含以下内容

  1. Edit config/routes.rb so that it contains root :to => 'proto#index'
  2. Create app/controllers/proto_controller.rb with the following contents

class ProtoController < ApplicationController

  def index
  end

end

  • 创建文件app /视图/原/ index.html.erb和写的东西在这个文件......你好世界。

  • Create file app/views/proto/index.html.erb and write something in that file ... 'Hello World'.

    然后启动你的环境。这应该工作。 当我尝试不按上述三个步骤,然后我也得到一个错误页面。但是,这些变化我没有看到一个错误页面。

    Then launch your environment. That should work. When I try without following the above three steps then I also get an error page. But with these changes I do not see an error page.

    我会建议你在一个新的环境中执行一个新的目录上面的步骤。我使用最新的Ruby解决方案堆栈64位亚马逊的Linux 2014.03 v1.0.4运行的Ruby 2.0(彪马)测试

    I would recommend you perform the above steps in a fresh directory on a new environment. I tested with the latest Ruby solution stack "64bit Amazon Linux 2014.03 v1.0.4 running Ruby 2.0 (Puma)".

    此外,在当你对这个教程,你可能最终与创业板mysql2替换宝石'sqlite3的'但那是当你得到示例应用程序运行的下一个步骤。

    Also at some point when you get to Step 6 on this tutorial, you might end up replacing gem 'sqlite3' with gem 'mysql2' but that is the next step after you get the sample app running.

    这篇关于Rails应用程序不能在AWS弹性魔豆运行,sqlite3的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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