Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the purpose of rails:update:bin rake task?

I'm not able to find much information about this task. I can't understand its purpose or when it should be run. Could someone explain what this task is about and why/when it's useful?

like image 901
Roman Avatar asked Apr 11 '16 00:04

Roman


People also ask

What is rake task in rails?

Rake is a popular task runner for Ruby and Rails applications. For example, Rails provides the predefined Rake tasks for creating databases, running migrations, and performing tests. You can also create custom tasks to automate specific actions - run code analysis tools, backup databases, and so on.

What is environment rake task?

Including => :environment will tell Rake to load full the application environment, giving the relevant task access to things like classes, helpers, etc. Without the :environment , you won't have access to any of those extras.


1 Answers

The rake rails:update:bin task creates binstubs for bundle, rails and rake.

Binstubs are wrapper scripts around executables (sometimes referred to as "binaries", although they don't have to be compiled) whose purpose is to prepare the environment before dispatching the call to the original executable.

In other words, the binstubs makes sure that the correct version of the gem included in your project is executed, achieving a similar result to bundle exec your_command, but without having to explicitly type it every time.

It is used to re-create your binstubs when they got removed for some reason, or when you are upgrading from Rails 3 that didn't provide them by default.

like image 177
p4sh4 Avatar answered Sep 30 '22 23:09

p4sh4