【发布时间】: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