【发布时间】:2014-08-04 02:16:13
【问题描述】:
我一直试图开始在 AWS 的 Elastic Beanstalk 上运行 Rails,但遇到了一个看似无法克服的障碍:虽然我能够启动一个新的 Elastic Beanstalk 运行示例应用程序,但我似乎无法获得一个 EB 实例来成功运行我自己的代码。
以下是我采取的步骤:
- 在 OSX 10.9.3 上本地运行 ruby 1.9.3p545
- 已安装 aws-eb 客户端工具。
- 严格按照 Amazon 的以下教程进行操作:Deploying a Rails Application to AWS Elastic Beanstalk (tl;dnr: 使用 'rails new' 创建一个新的 rails 应用程序,提交到 git,然后使用 'eb init' 创建一个类型为 ' 的 EB 实例64 位 Amazon Linux 2014.03 v1.0.3 运行 Ruby 1.9.3' 然后运行 'eb start')
- 在等待创建 EB 实例的时间似乎很长之后,我导航到 Amazon 提供的 URL。
- 我没有看到我的 rails 应用程序(顺便说一句,它在本地运行良好),而是看到可怕的“我们很抱歉,但出了点问题”页面:
我已多次尝试这些步骤,结果相同。我尝试过使用不同的环境(例如 Ruby 2.0.0 Puma 和 Passenger 的环境,必要时通过 rvm 更新我的 ruby)。
在这被标记为重复之前,让我直接声明,我查看了以下问题并发现它们没有解决我的问题:
AWS Elastic Beanstalk: Launching a new Rails App
Deploying an existing Rails app to AWS Elastic Beanstalk
按照问题“AWS Elastic Beanstalk:启动新的 Rails 应用程序”中的建议,这似乎与我的问题非常相似,我让应用程序运行了一夜,但仍然出现错误。
我已经 ssh 进入了实例。有趣的是,production.log 和 development.log 似乎都是空的(无论如何都在 /var/app/support/logs 中)。但是,我在passenger.log 中找到以下内容:
*********截图*********
[ 2014-06-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 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-06-12 21:45:26.2512 5133/7fe66d1ef700 Pool2/Implementation.cpp:883 ]:无法为组 /var/app/current#default 生成进程:启动 th$ 时发生错误 在'无效乘客::ApplicationPool2::SmartSpawner::handleErrorResponse(Passenger::ApplicationPool2::SmartSpawner::StartupDetails&)' (SmartSpawner.h:455) 在 'std::string Passenger::ApplicationPool2::SmartSpawner::negotiatePreloaderStartup(Passenger::ApplicationPool2::SmartSpawner::StartupDetails&)' (SmartSpawner.h:566) 在“无效乘客::ApplicationPool2::SmartSpawner::startPreloader()”(SmartSpawner.h:206) 在'虚拟乘客::ApplicationPool2::ProcessPtr Passenger::ApplicationPool2::SmartSpawner::spawn(const Passenger::ApplicationPool2::Options&)' (SmartSpawner.h:752) 在 'void Passenger::ApplicationPool2::Group::spawnThreadRealMain(const Passenger::ApplicationPool2::SpawnerPtr&, const Passenger::ApplicationPool2::Options&, unsigned in$
********结束片段********
不确定 sqlite3 是否是问题所在,但它似乎已安装在实例上。以防万一,我再次安装了 sqlite3 gem。
这是乘客状态的输出:
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)。
我错过了什么?是否有一些我忽略设置为 true 的“JUST_WORK_DARNIT”配置?
如果 sqlite3 安装确实存在问题,如下所示,我可以做些什么来解决这个问题?
【问题讨论】:
标签: ruby-on-rails amazon-web-services sqlite passenger amazon-elastic-beanstalk