我如何从 jquery-ui-rails gem 的版本中找出 JQuery UI 的版本?

How do i figure out the version of JQuery UI from version of jquery-ui-rails gem?

我正在使用 Rails 4.2.7。在我的 Gemfile 中,我有

gem 'rails', '~> 4.2.7'
…
gem 'jquery-ui-rails'

如何确定我使用的 JQuery UI 版本?

bundle show jquery-ui-rails

此命令将显示您的项目中使用的 gem 的哪个版本。您还可以检查 Gemfile.lock 文件或键入

bundle show

显示所有正在使用的 gem。

要查看任何网站使用的 jquery-ui 插件的版本,您可以在浏览器的开发人员工具中打开控制台选项卡,然后键入:

$.ui

您查看文件 VERSIONS.md,您可以在其中看到以下内容(前五行):

5.0.5   1.11.4
5.0.4   1.11.3
5.0.3   1.11.2
5.0.2   1.11.2
5.0.1   1.11.1

来自 JQuery UI Rails README 文件:

See VERSIONS.md to see which versions of jquery-ui-rails bundle which versions of jQuery UI.

  1. 使用 bundle show 了解 jquery gem -

    的版本
    bundle show jquery
    

    它会列出类似 -

    1 : jquery-rails
    2 : jquery-ui-rails
    3 : rails-jquery-autocomplete
    0 : - exit -
    
  2. Select适当的选项。在我的系统中选择 2(jquery-ui-rails) 它显示 -

    .../jquery-ui-rails-6.0.1
    
  3. 检查 gem 到 jquery 版本映射 @ https://github.com/jquery-ui-rails/jquery-ui-rails/blob/master/VERSIONS.md 。在我的例子中是

    Gem      jQuery UI
    6.0.1    1.12.1
    

注意:我结合了@Hans Findel 和@MarsAtomic 的回答。