Wednesday, August 1, 2018

ruby - What does 'require: false' in Gemfile mean?




Does this:



gem 'whenever', require: false


mean that the gem needs to be installed, or does it mean it is not required?


Answer



This means install the gem, but do not call require when you start Bundler. So you will need to manually call



require "whenever"



if you want to use the library.



If you were to do



gem "whenever", require: "whereever"


then bundler would download the gem named whenever, but would call




require "whereever"


This is often used if the name of library to require is different than the name of the gem.


No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...