【问题标题】:Can't run command rails console on EC2 after deploy部署后无法在 EC2 上运行 command rails 控制台
【发布时间】:2015-06-03 15:22:36
【问题描述】:

我使用 AWSElasticbeanstalk 来部署我的应用程序,但是一旦 ssh 到我的服务器并转到 /var/app/current,我就无法运行命令 rails console

我尝试了很多命令,但没有成功:

  • bundle exec rails c
  • RAILS_ENV=development rails c

我收到以下错误:

Could not find addressable-2.3.6 in any of the sources
Run `bundle install` to install missing gems.

但是当运行bundle install 时,一切都很好。

这个错误对我来说是个大问题,因为我无法使用 whenever cron 作业。

你能帮帮我吗?

PS : 我的 Gemfile 的要点here

【问题讨论】:

  • 您的 EC2 使用的是系统 ruby​​ 还是 RVM 之类的东西?
  • 我的 EC2 实例正在运行 Ruby。我不确定 RVM(找不到命令)。
  • 你试过bundle exec rails c production吗?
  • 是的,我收到了Could not find addressable-2.3.6 in any of the sources Run bundle install to install missing gems.
  • 您能否添加您的GemfileGemfile.lock 以及gem list addressable 的输出?

标签: ruby-on-rails amazon-web-services amazon-ec2 amazon-elastic-beanstalk


【解决方案1】:

遇到了类似的问题,这就是解决我的问题的方法:

您可以从根目录尝试sudo gem install bundler,然后移至app/current 并尝试运行rails c -e environment_name

【讨论】:

  • 嗯,我的问题已经解决,因为我将我的 EB 环境更新到了最后一次更新。但是,我仍然需要更改 log 目录的 CHMOD 才能访问 rails c
猜你喜欢
  • 2012-05-05
  • 2020-06-03
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-10-31
  • 1970-01-01
  • 1970-01-01
  • 2016-09-16
相关资源
最近更新 更多