I'm trying to launch a rails application to Elastic Beanstalk.
我正在尝试启动一个rails应用程序到弹性豆茎。
On the tutorial here: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_Ruby_rails.html
在本教程中:http://docs.aws.amazon.com/elasticity beanstalk/latest/create_deploy_ruby_rails.html
I'm on step 6.3 where it covers updating the application.
我在第6.3步,它涵盖了更新应用程序。
eb status --verbose
returns ready and green.
返回准备和绿色。
Although, the page that displays at the url it gives me says:
虽然,在它给我的url上显示的页面说:
"The page you were looking for doesn't exist.
你要找的那一页根本不存在。
You may have mistyped the address or the page may have moved."
你可能写错了地址,或者页面移动了。
The tutorial is expecting the "Welcome aboard You’re riding Ruby on Rails!" page to render.
本教程期待“欢迎您乘坐Ruby on Rails!”页面呈现。
What might be the issue here? I'm pretty new at this so I'm not sure where to begin diagnosing the issue.
这里的问题是什么?我对这方面很陌生,所以我不确定从哪里开始诊断这个问题。
I've ran rails s for this apps local directory and it does display the "Welcome aboard You’re riding Ruby on Rails!" page properly.
我为这个应用程序本地目录运行了rails s,它正确地显示了“欢迎您乘坐Ruby on rails !”页面。
Thanks!
谢谢!
When I do eb status --verbose it does return green and ready although just before that it gives me this error twice like this:
当我做eb状态时,它会返回绿色并准备就绪尽管在此之前它会给我两次这样的错误:
error: git-credential-osxkeychain died of signal 11
error: git-credential-osxkeychain died of signal 11
I followed the tutorial here https://help.github.com/articles/set-up-git to fix this signal 11 error. The error is gone, although visiting the url where my site is located still gives me the same error page.
我遵循了这个教程,https://help.github.com/articles/set-up-git来修复这个信号11错误。错误消失了,尽管访问我的站点所在的url仍然给了我相同的错误页面。
Ok I fixed the signal 11 error, although its still not rendering the Ruby on Rails welcome page.
我修正了信号11的错误,尽管它仍然没有渲染Ruby on Rails欢迎页面。
When I create an Application from the Elastic Beanstalk UI the Sample Application works fine. But when I upload the app files on my computer to EB and deploy the link to view the app says "403 Forbidden".
当我从弹性Beanstalk UI创建应用程序时,示例应用程序运行良好。但是,当我把应用文件上传到我的电脑上,并将链接部署到EB上时,应用会说“403禁止”。
Again, this is just a plain vanilla app that works fine locally.
同样,这只是一个普通的应用程序,在本地运行良好。
EB UI says "Green and Healthy" as well.
EB UI也说“绿色健康”。
I reinstalled git and consequently updated it, and then just continued on with the tutorial even though the correct page still isn't rendering. Basically I completed the tutorial except for the termination part.
我重新安装了git,并因此更新了它,然后继续使用教程,尽管正确的页面仍然没有呈现。基本上我完成了教程,除了终止部分。
Now I get a 502 Bad Gateway error.
现在我得到了502个错误的网关。
Using "eb log" I found that I keep getting a message about installing mysql2 and adding it to the gemfile, which I have already done and ran "bundle install". Nada.
使用“eb日志”,我发现我不断收到关于安装mysql2并将其添加到gemfile的消息,我已经完成了这一操作,并运行了“bundle install”。没有什么结果。
It is, however, included in my gem list.
然而,它包含在我的创业板列表中。
2 个解决方案
#1
1
Of course there are not many clues of what might be wrong, but you can have a look at the log after connecting to your instance through ssh.
当然,没有太多的线索表明哪里出错了,但是您可以在通过ssh连接到实例之后查看日志。
In short:
简而言之:
-
connect to your instance through ssh
通过ssh连接到实例
-
go to /var/app/current/log
去/var/app/current/log
-
read the production.log file
看生产。日志文件
You can find a step-by-step guide in this post:
你可以在这篇文章中找到一步一步的指南:
http://karmarails.wordpress.com/2013/08/25/production-sort-of-debugging-on-an-aws-machine-for-a-rails-application/
#2
1
I had to do the following to stop the 502 Bad Gateway errors. After the app was uploaded using the Dashboard and selecting the Ruby environment go to your rails application on your dev box an install eb cli
为了阻止502个错误的网关错误,我必须执行以下操作。在使用仪表板上载应用程序并选择Ruby环境后,在开发框上的安装eb cli上转到rails应用程序
$ pip install awsebcli
$ eb init
Select a default region
1) us-east-1 : US East (N. Virginia)
2) us-west-1 : US West (N. California)
3) us-west-2 : US West (Oregon)
4) eu-west-1 : EU (Ireland)
5) eu-central-1 : EU (Frankfurt)
6) ap-south-1 : Asia Pacific (Mumbai)
7) ap-southeast-1 : Asia Pacific (Singapore)
8) ap-southeast-2 : Asia Pacific (Sydney)
9) ap-northeast-1 : Asia Pacific (Tokyo)
10) ap-northeast-2 : Asia Pacific (Seoul)
11) sa-east-1 : South America (Sao Paulo)
12) cn-north-1 : China (Beijing)
(default is 3): 3
Select an application to use
1) [your eb environment you created] ****PICK THE ENV YOU CREATED ON EB
2) [ Create new Application ]
(default is 2): 1
$ rake secret
[your very long key returned]
$ eb setenv SECRET_KEY_BASE=[your very long key returned]
pip安装awsebcli eb美元init选择默认区域1)us-east-1:美国东部(n维吉尼亚)2)us-west-1:美国西部(n .加州)3)us-west-2:美国西部(俄勒冈州)4)一来:欧盟(爱尔兰)5)eu-central-1:欧盟(法兰克福)6)ap-south-1:亚太(孟买)7)ap-southeast-1:亚太(新加坡)8)ap-southeast-2:亚太(悉尼)9)ap-northeast-1:亚太(东京)10)ap-northeast-2:亚太(首尔)11)sa-east-1:南美洲(圣保罗)12)cn-north-1:中国(北京)(默认值是3):选择一个应用程序使用1)[您创建的eb环境]**** *选择您在eb 2上创建的环境][创建新应用程序](默认值是2):1 $ rake secret[您的超长密钥返回]$ setenv SECRET_KEY_BASE=[您的超长密钥返回]
wait and you will see this...
INFO: Environment update is starting.
INFO: Updating environment [your eb environment you created]'s
configuration settings.
INFO: Environment health has transitioned from Ok to Info. Configuration update in progress (running for 17 seconds).
INFO: Successfully deployed new configuration to environment.
等等,你会看到这个……信息:环境更新正在启动。信息:更新环境[您创建的eb环境]的配置设置。信息:环境健康已经从Ok转变为INFO。正在进行配置更新(运行17秒)。信息:成功地将新配置部署到环境中。
Now access the URL and there should be no Bad Gateway error. The commands above create a environment variable called SECRET_KEY_BASE and placed it up on the webnode that runs your app
现在访问URL,应该不会出现错误网关。上面的命令创建一个名为SECRET_KEY_BASE的环境变量,并将其放在运行应用程序的webnode上
#1
1
Of course there are not many clues of what might be wrong, but you can have a look at the log after connecting to your instance through ssh.
当然,没有太多的线索表明哪里出错了,但是您可以在通过ssh连接到实例之后查看日志。
In short:
简而言之:
-
connect to your instance through ssh
通过ssh连接到实例
-
go to /var/app/current/log
去/var/app/current/log
-
read the production.log file
看生产。日志文件
You can find a step-by-step guide in this post:
你可以在这篇文章中找到一步一步的指南:
http://karmarails.wordpress.com/2013/08/25/production-sort-of-debugging-on-an-aws-machine-for-a-rails-application/
#2
1
I had to do the following to stop the 502 Bad Gateway errors. After the app was uploaded using the Dashboard and selecting the Ruby environment go to your rails application on your dev box an install eb cli
为了阻止502个错误的网关错误,我必须执行以下操作。在使用仪表板上载应用程序并选择Ruby环境后,在开发框上的安装eb cli上转到rails应用程序
$ pip install awsebcli
$ eb init
Select a default region
1) us-east-1 : US East (N. Virginia)
2) us-west-1 : US West (N. California)
3) us-west-2 : US West (Oregon)
4) eu-west-1 : EU (Ireland)
5) eu-central-1 : EU (Frankfurt)
6) ap-south-1 : Asia Pacific (Mumbai)
7) ap-southeast-1 : Asia Pacific (Singapore)
8) ap-southeast-2 : Asia Pacific (Sydney)
9) ap-northeast-1 : Asia Pacific (Tokyo)
10) ap-northeast-2 : Asia Pacific (Seoul)
11) sa-east-1 : South America (Sao Paulo)
12) cn-north-1 : China (Beijing)
(default is 3): 3
Select an application to use
1) [your eb environment you created] ****PICK THE ENV YOU CREATED ON EB
2) [ Create new Application ]
(default is 2): 1
$ rake secret
[your very long key returned]
$ eb setenv SECRET_KEY_BASE=[your very long key returned]
pip安装awsebcli eb美元init选择默认区域1)us-east-1:美国东部(n维吉尼亚)2)us-west-1:美国西部(n .加州)3)us-west-2:美国西部(俄勒冈州)4)一来:欧盟(爱尔兰)5)eu-central-1:欧盟(法兰克福)6)ap-south-1:亚太(孟买)7)ap-southeast-1:亚太(新加坡)8)ap-southeast-2:亚太(悉尼)9)ap-northeast-1:亚太(东京)10)ap-northeast-2:亚太(首尔)11)sa-east-1:南美洲(圣保罗)12)cn-north-1:中国(北京)(默认值是3):选择一个应用程序使用1)[您创建的eb环境]**** *选择您在eb 2上创建的环境][创建新应用程序](默认值是2):1 $ rake secret[您的超长密钥返回]$ setenv SECRET_KEY_BASE=[您的超长密钥返回]
wait and you will see this...
INFO: Environment update is starting.
INFO: Updating environment [your eb environment you created]'s
configuration settings.
INFO: Environment health has transitioned from Ok to Info. Configuration update in progress (running for 17 seconds).
INFO: Successfully deployed new configuration to environment.
等等,你会看到这个……信息:环境更新正在启动。信息:更新环境[您创建的eb环境]的配置设置。信息:环境健康已经从Ok转变为INFO。正在进行配置更新(运行17秒)。信息:成功地将新配置部署到环境中。
Now access the URL and there should be no Bad Gateway error. The commands above create a environment variable called SECRET_KEY_BASE and placed it up on the webnode that runs your app
现在访问URL,应该不会出现错误网关。上面的命令创建一个名为SECRET_KEY_BASE的环境变量,并将其放在运行应用程序的webnode上