简体   繁体   English

为什么heroku不列出与我本地相同的宝石?

[英]why does heroku not list the same gems as i have locally?

I'm still pretty new to heroku and git hub and rails. 我对heroku和git hub和rails还是很陌生。

My app works locally, but fails on Heroku. 我的应用程序在本地运行,但在Heroku上无法运行。 The lines of failure indicate it's because it's missing the plugin I installed locally. 失败行表明这是因为它缺少我在本地安装的插件。

This is a basic question that I can't seem to find. 这是我似乎找不到的基本问题。 How do I ensure that or update the list of gems on heroku to match my local setup? 如何确保或更新heroku上的宝石列表以匹配我的本地设置?

I have the gem in my gemfile, and have pushed to git. 我的gemfile中有该gem,并已推送到git。 When I go in heroku console and type gem list it's not there. 当我进入heroku控制台并输入gem list它不存在。

Thanks 谢谢

EDIT. 编辑。 Solved. 解决了。 Can't answer my own question for 24 hours. 24小时无法回答我自己的问题。 I had :group => development listed next to the gem. 我在宝石旁边列出了:group => development。 I don't even remember putting that there. 我什至不记得把它放在那里。 Removed it, obviously, and problem solved. 显然,将其删除并解决了问题。

Make sure you run bundle install before pushing to heroku. 确保在推送到heroku之前运行bundle install This generates your Gemfile.lock file that ensures the gems are the same on heroku and locally. 这将生成您的Gemfile.lock文件,以确保在heroku和本地上的宝石是相同的。

Because Heroku adds some gems to your Gemfile. 因为Heroku向您的Gemfile添加了一些宝石。 This is how Heroku works. 这就是Heroku的工作方式。 Take a Rack app. 采取机架应用程序。 Heroku will add thin to it because that's how they want to run your Rack app. Heroku会增加它的薄度,因为这就是他们想要运行您的Rack应用程序的方式。 Also they don't install your test and dev gems. 此外,他们不会安装您的测试和开发工具。 Just production. 只是生产。

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

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