You have already activated rack 1.6.0, but your Gemfile requires rack 1.6.4. Prepending `bundle exec` to your command may solve this. (Gem::LoadError)

假如想象 提交于 2019-12-10 18:08:42

问题


I'm working with Elastic Beanstalk and I'm getting this error in my logs-

You have already activated rack 1.6.0, but your Gemfile requires rack 1.6.4. Prepending bundle exec to your command may solve this. (Gem::LoadError)

I've seen all related questions(Related Question) but nothing worked for me. When I do gem list | grep rack i get-

rack (1.6.4)
rack-test (0.6.3)

That means I don't have rack(1.6.0) installed, which is confirmed when I do gem uninstall rack -v 1.6.0 it gives me-

ERROR: While executing gem ... (Gem::InstallError) gem "rack" is not installed

What should I do? Should I uninstall rack 1.6.4? (that gives me a warning that I won't have any rack versions)


回答1:


There appears to be some sort of sniffing of the gemfile going on. Try adding your ruby server to the gemfile explicitly e.g.

gem 'puma'

This convinced EB to load the rack specified in the Gemfile in my case.




回答2:


I deleted my gemlock file and push my app to production . Then i get into my root-app folder of hosting . and ran the following command and it made my app work properly

gem install rack


来源:https://stackoverflow.com/questions/32241508/you-have-already-activated-rack-1-6-0-but-your-gemfile-requires-rack-1-6-4-pre

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!