繁体   English   中英

无法与Heroku和Rails一起安装puma gem

[英]can't install puma gem, using with Heroku and rails

Heroku最近建议使用puma网络服务器gem而不是unicorn。 因此,我卸下了独角兽宝石并安装了彪马宝石。 它会安装到Gemfile ,而不是Gemfile.lock 我不知道发生了什么事。 这是我执行的代码和步骤。

的Gemfile:

gem 'puma', '~> 2.11.0' - in the production group

运行bundle install ,正在运行的gem list显示(以及其他):

psych (2.0.5)
puma (2.11.0)
pundit (0.3.0)
rack (1.6.0)

但是它不在Gemfile.lock

pg (0.18.1)
pry (0.10.1)
  coderay (~> 1.1.0)
  method_source (~> 0.8.1)
  slop (~> 3.4)
pundit (0.3.0)
  activesupport (>= 3.0.0)
rack (1.6.0)

运行工头证实了这一点。 从命令行foreman startforeman start

19:58:11 web.1  | started with pid 51379
19:58:12 web.1  | /Users/dougharman/.rvm/gems/ruby-2.1.5/gems/bundler-1.7.12/lib/
  bundler/rubygems_integration.rb:256:in `block in replace_gem': 
  puma is not part of the bundle. Add it to Gemfile. (Gem::LoadError)
19:58:12 web.1  |   from /Users/dougharman/.rvm/gems/ruby-2.1.5/bin/puma:22:in `<main>'
19:58:12 web.1  |   from /Users/dougharman/.rvm/gems/ruby-2.1.5/bin/ruby_executable_hooks:15:in `eval'
19:58:12 web.1  |   from /Users/dougharman/.rvm/gems/ruby-2.1.5/bin/ruby_executable_hooks:15:in `<main>'
19:58:12 web.1  | exited with code 1
19:58:12 system | sending SIGTERM to all processes
SIGTERM received

有几个SO问题与运行Windows的类似问题有关。 我在Mac OSX Mavericks,Ruby 2.1.5和Rails 4.2.0上。 根据一些SO问答,我卸载了rvm和ruby(包括所有以前的版本)并重新安装了它们。 我仍然得到相同的结果。

任何想法都欢迎。 巧合的是,我尝试重新安装独角兽,但没有成功。 我只触摸了Heroku文章“ 使用Puma Web服务器部署Rails应用程序”中提到的其他文件。该部署以前使用unicorn进行。 预先感谢您的建议。 我没主意,否则就沉迷于水中,直到本周末芝加哥红宝石北岸见面会!

如我的评论中所述,属于生产组的宝石将不会在开发中运行(除非您有意在本地运行生产环境)

如果您确实要在开发中运行Puma(建议这样做),请从Gemfile的生产组中将其删除,然后再次运行bundle install

所以这:

group :production do
  gem 'puma'
end

变成:

gem 'puma'  

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM