Where is the pattern of code that creates ruby/bin/rails file

て烟熏妆下的殇ゞ 提交于 2020-01-25 08:15:27

问题


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

Last two elements of this chain I able to find in the GitHub.

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?


回答1:


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"]


来源:https://stackoverflow.com/questions/59269130/where-is-the-pattern-of-code-that-creates-ruby-bin-rails-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!