After generating a Gemfile.lock from Gemfile, is there any tool to round-trip back to freeze versions in the Gemfile. I'd rather avoid doing it manually.
生成一个Gemfile之后。从Gemfile中锁定,是否有工具返回到Gemfile中冻结版本。我宁愿避免手工操作。
Background: It's good practice to freeze minor version on gems, e.g. if Gemfile.lock is 2.4.1, I'd want to update Gemfile to include ~> 2.4 (as explained here).
背景:在宝石上冻结小版本是很好的做法,例如,如果Gemfile。锁是2.4.1,我想更新Gemfile,包括~> 2.4(如本文所述)。
1 个解决方案
#1
0
You should define the gem verions that you wanna freeze your app to in the GemFile itself before you run bundle install. Once, you have that define and you run bundle install
, it will generate a Gemfile.lock with the versions of all installed gems and their dependancies.
您应该在运行bundle install之前定义要将应用程序冻结到GemFile本身中的gem验证。一旦您有了那个定义并运行bundle install,它将生成一个Gemfile。锁定所有已安装的宝石及其附属品的版本。
again, .lock file is auto-generated ans should not be manually editted. this is what the GemFile is for.
同样,.lock文件是自动生成的ans,不应该手动编辑。这就是GemFile的用途。
#1
0
You should define the gem verions that you wanna freeze your app to in the GemFile itself before you run bundle install. Once, you have that define and you run bundle install
, it will generate a Gemfile.lock with the versions of all installed gems and their dependancies.
您应该在运行bundle install之前定义要将应用程序冻结到GemFile本身中的gem验证。一旦您有了那个定义并运行bundle install,它将生成一个Gemfile。锁定所有已安装的宝石及其附属品的版本。
again, .lock file is auto-generated ans should not be manually editted. this is what the GemFile is for.
同样,.lock文件是自动生成的ans,不应该手动编辑。这就是GemFile的用途。