创建ruby/bin/rails文件的代码模式在哪里 [英] Where is the pattern of code that creates ruby/bin/rails file
问题描述
今天,我以系统执行rails
命令的方式进行工作.并发现了这条链子
Today I worked with the way a system executes rails
command. And discovered this chain
ruby_instalation_dir/bin/rails
-> ruby/gems/reilaties/exe/rails -> ruby/gems/reilaties /lib/rails/cli.rb
我可以在GitHub上找到该链的最后两个元素.
Last two elements of this chain I able to find in the GitHub.
现在我正在寻找什么指令,这些指令告诉RubyGem
如何生成rails
文件.我在 rails.gemspec railaties的任何匹配项>文件.但是RubyGem
如何知道需要调用railaties
gem.此信息存储在哪里?
Now I'm seeking what is the instructions that tell RubyGem
how to generate rails
file. I did not find any match of railaties
in the rails.gemspec file. But some how RubyGem
knows that need to call railaties
gem. Where does this information stored?
推荐答案
rails
命令是 railties 宝石的一部分,而不是 rails 宝石的一部分.因此,您需要查看 railties gemspec :
The rails
command is part of the railties gem, not part of the rails gem. Therefore, you need to look in the railties gemspec:
s.bindir = "exe"
s.executables = ["rails"]
这篇关于创建ruby/bin/rails文件的代码模式在哪里的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!