Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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'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)

like image 794
krishna Avatar asked Oct 19 '22 03:10

krishna


1 Answers

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.

like image 80
bkconrad Avatar answered Oct 21 '22 22:10

bkconrad