美文网首页
gem 'whenever', '0.9.4', require

gem 'whenever', '0.9.4', require

作者: 陈威严 | 来源:发表于2020-05-15 15:48 被阅读0次

gem requite: false

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.

Is this done for performance reasons? – Venkat D. May 7 '12 at 18:50

@VenkatD. sometimes you want to install certain gems but you don't want to load them in to every process. I have a particular rake task that I want to invoke periodically on Heroku through their schedular add-on. This particular rake task requires certain gems that the rest of the application doensn't need. So I :require => false these particular gems and explicitly require "thegem" from the rake task. This would then save memory in the main app processes and startup time etc. App performance, however, should not be affected even if you require these additional gems in every process.

参考链接

https://stackoverflow.com/questions/4800721/what-does-require-false-in-gemfile-mean

https://ruby-china.org/topics/32678

相关文章

  • gem 'whenever', '0.9.4', require

    gem requite: false This means install the gem, but do not...

  • whenever

    Rails Gem开发(二)——whenever实现周期性任务 - 简书

  • gem 提示`gem_original_require': Li

    今天在更新项目的pod库,经历版本冲突卸载重装各种操作之后,在执行gem命令时,一直提示以上错误,我解决的办法是,...

  • ruby debug

    首先是安装 debugger gem install pry接着在 Podfile 的开头导入 require '...

  • sidekiq的定时任凭之Sidekiq-Cron

    之前介绍过sidekiq定时任务用whenever,使用中发现莫名的消耗内存,于是又找其它的gem试试,发现Sid...

  • ruby on rails实现周期性任务whenever

    周期性任务可以使用whenever,sidetiq等gem,一次性任务可以使用sidekiq来完成 1. when...

  • Whenever

    Whenever you fix yourself on one thought, or one situatio...

  • Rails Gem开发(二)——whenever实现周期性任务

    根据项目的进展,我们需要实现后台进行定时读取信息的功能,而最关键的实现部分是周期性功能,根据调研,决定使用when...

  • Eyes On Me

    whenever sang my songs. on the stage,on my own! whenever ...

  • whenever and whereve

    那些无论何时何地一想起就会觉得无比“尴尬”的事情,不是说忘就能忘、想忘就能忘,因为它已经在你的脑袋里回放了无数遍,...

网友评论

      本文标题:gem 'whenever', '0.9.4', require

      本文链接:https://www.haomeiwen.com/subject/ztwcohtx.html