【问题标题】:Ubuntu + Unicorn: You must use Bundler 2 or greater with this lockfile. (Bundler::LockfileError)Ubuntu + Unicorn:您必须使用 Bundler 2 或更高版本与此锁定文件。 (Bundler::LockfileError)
【发布时间】:2020-07-04 09:49:24
【问题描述】:

我在 Ubuntu 16 上运行 unicorn 时遇到问题。尝试运行它时 - 手动 (service unicorn_myapp_staging restart) 或通过 Capistrano,我收到以下消息:您必须使用 Bundler 2 或更高版本和此锁定文件。 (Bundler::LockfileError)(下面是完整的错误轨迹)

/home/deployer/.rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler/lockfile_parser.rb:108:in `warn_for_outdated_bundler_version': You must use Bundler 2 or greater with this lockfile. (Bundler::LockfileError)
    from /home/deployer/.rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler/lockfile_parser.rb:95:in `initialize'
    from /home/deployer/.rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler/definition.rb:72:in `new'
    from /home/deployer/.rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler/definition.rb:72:in `initialize'
    from /home/deployer/.rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler/dsl.rb:200:in `new'
    from /home/deployer/.rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler/dsl.rb:200:in `to_definition'
    from /home/deployer/.rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler/dsl.rb:12:in `evaluate'
    from /home/deployer/.rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler/definition.rb:33:in `build'
    from /home/deployer/.rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler.rb:128:in `definition'
    from /home/deployer/.rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler.rb:94:in `setup'
    from /home/deployer/.rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler/setup.rb:20:in `<top (required)>'
    from /home/deployer/.rvm/rubies/ruby-2.3.3/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /home/deployer/.rvm/rubies/ruby-2.3.3/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'

如果我检查 bundler 的版本,它似乎没问题:

bundle info bundler
  * bundler (2.1.4)
    Summary: The best way to manage your application's dependencies
    Homepage: https://bundler.io
    Path: /home/deployer/.rvm/gems/ruby-2.6.3/gems/bundler-2.1.4

但是,正如上面错误消息中所述,与新升级的 ruby​​ (2.6.3) 和 bundler (2.1) 相比,使用的 ruby​​ 和 bundler 版本看起来很旧(2.3.3 和 1.14.3) .4)。

在哪里设置正确版本的 ruby​​ 和 bundler 以启动 Unicorn? Ubuntu 上是否有隐藏的配置文件,我需要在哪里指定它?

【问题讨论】:

  • 就像我在other questions 上要求的那样,您最近发布了有关此应用程序的信息,请说明您是如何构建、部署和启动此应用程序的。有这么多不同的可能配置,到目前为止您提供的信息基本上是无用的。

标签: ruby-on-rails ruby capistrano bundler unicorn


【解决方案1】:

试试这个修复,看起来像是 Gemfile.lock 的问题。尝试从 gemfile.lock 中删除 BUNDLED WITH。

删除类似的东西并重新构建

BUNDLED WITH
   2.1.4

【讨论】:

  • 请更新您的问题以提供更多上下文。
猜你喜欢
  • 2019-04-13
  • 2020-04-14
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-06-20
  • 1970-01-01
  • 1970-01-01
  • 2019-09-18
相关资源
最近更新 更多