问题
I know that bundler makes a gems executables available using the bundle exec
command. I want to understand how I can call these executables from inside a controller action or model class method? I don't see anything about this in the Bundler doco.
回答1:
Executables are ruby scripts sitting in the bin
directory of the gems and their behavior depend on each gem. They are wrappers around the gems classes/APIs: simply dig into the source code of the gems you target and mimic the behavior of their CLIs.
来源:https://stackoverflow.com/questions/14011404/call-a-rubygems-binary-executable-from-inside-my-rails-applications