我可以将我的Gemfile重命名为Gemfile.rb [英] Can I rename my Gemfile to Gemfile.rb
问题描述
如果没有文件扩展名,我无法获得语法突出显示来坚持。这不是世界末日,但我很感激它。
Without a file extension I can't get syntax highlighting to persist. That's not the end of the world, but I'd appreciate having it.
如果我重命名 Gemfile $ c $,它会打破Rails c> as
Gemfile.rb
?
Will it break Rails if I rename Gemfile
as Gemfile.rb
?
推荐答案
重命名它,但捆绑器不会自动找到它。
It looks like you can rename it, but bundler will not automatically find it.
然而,你可以在每个bundler命令前添加 BUNDLE_GEMFILE = Gemfile.rb $
However, you can just prepend every bundler command with BUNDLE_GEMFILE=Gemfile.rb
and it'll work:
BUNDLE_GEMFILE=Gemfile.rb bundle install
你也可以看看 http://gembundler.com/man/bundle-config.1.html - 它提到了一个gemfile选项,但我无法让它工作(即使手动设置为 Gemfile.rb
,它仍然试图寻找 Gemfile
)。
You might also look at http://gembundler.com/man/bundle-config.1.html -- It mentions a gemfile option, but I couldn't get it to work (even after manually setting it to Gemfile.rb
, it still tried to look for Gemfile
).
这篇关于我可以将我的Gemfile重命名为Gemfile.rb的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!