Why is ‘bundle exec’ necessary? 【Ruby on Rails】

Basically, “bundle exec” command precedes rails commands. My subordinate asked me about the necessity of this command. I’m going to write it down here.

Rails has gemfile.lock file that solves dependencies among gems. When we use bundle exec command, gemfile.lock file is referred to. Instead of that, if we don’t use bundle exec command, gemfile.lock file isn’t referred to. As a result, a gem might not work properly.

My LinkedIn account is below! Please contact me!

https://www.linkedin.com/in/tomoharu-tsutsumi-56051a126/

--

--

Tomoharu Tsutsumi

Senior Software Engineer at two industry-leading startups ( Go | Ruby | TypeScript | JavaScript | Gin | Echo | Rails | React | Redux | Next)