gpt4 book ai didi

ruby-on-rails - 为什么在 Rails 中需要 binstubs?

转载 作者:行者123 更新时间:2023-12-05 03:12:45 26 4
gpt4 key购买 nike

我不完全理解 Rails 中 binstubs 功能的用途。

例如,当我运行 bin/bundle binstubs rspec-rails 时,我得到以下输出:

rspec-rails has no executables, but you may want one from a gem it depends on.
railties has: rails
rspec-core has: autospec, rspec

这是什么意思?为什么我需要 bin/bundle binstubs rspec-core 命令?

最佳答案

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

In the Ruby world, the most common binstubs are the ones that RubyGemsgenerates after installing a gem that contains executables. Butbinstubs can be written in any language, and it often makes sense tocreate them manually.

来源:rbenv wiki – Understanding binstubs

关于ruby-on-rails - 为什么在 Rails 中需要 binstubs?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32460121/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com