【问题标题】:How to install rails_admin gem in Rails 4如何在 Rails 4 中安装 rails_admin gem
【发布时间】:2016-07-15 21:04:43
【问题描述】:

我想安装 RailsAdmin gem。当我运行bundle install 时,我得到:

Bundler could not find compatible versions for gem "jquery-ui-rails": 
In Gemfile:
    jquery-ui-sass-rails was resolved to 4.0.3.0, which depends on
      jquery-ui-rails (= 4.0.3)

    rails_admin was resolved to 0.6.4, which depends on
      jquery-ui-rails (~> 5.0) Bundler could not find compatible versions for gem "rails":   In Gemfile:
    rails (= 4.2.4)

    rails_admin was resolved to 0.0.1, which depends on
      rails (~> 3.1) Bundler could not find compatible versions for gem "sass-rails":   In Gemfile:
    sass-rails (~> 5.0)

    rails_admin was resolved to 0.6.1, which depends on
      sass-rails (~> 4.0)

我尝试删除 Gemfile.lock 并重新运行 bundle install,但没有成功。

这是我的 Gemfile:

source 'https://rubygems.org'


gem 'rails', '4.2.4'
gem 'mysql2', '~> 0.3.18'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'therubyracer', platforms: :ruby

gem 'jquery-rails'
gem 'fancybox2-rails'
gem "select2-rails"

gem 'jquery-ui-sass-rails'

gem 'momentjs-rails', '~> 2.10.2'

gem 'turbolinks'
gem 'jbuilder', '~> 2.0'

gem 'sdoc', '~> 0.4.0', group: :doc

gem 'bootstrap-sass', '~> 3.3.6'
gem 'bootstrap-material-design'

gem 'geocoder'
gem 'gmaps4rails'
gem 'chewy'

gem "font-awesome-rails"

gem 'cells'
gem 'cells-erb'

gem 'rails-i18n'
gem 'devise'
gem 'omniauth-twitter'
gem 'omniauth-facebook'
gem 'koala'

gem 'rails_admin'
gem 'rmagick'
gem 'carrierwave'
gem 'fog'
gem 'htmlentities'

#editor
gem "wysiwyg-rails"

gem 'pundit', github: 'elabs/pundit'

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug'
end

group :development do
  # Access an IRB console on exception pages or by using <%= console %> in views
  gem 'web-console', '~> 2.0'

  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
end

我的 Ruby 和 Rails 版本是:

* Ruby 2.1.4p265 (2014-10-27 revision 48166) [i686-linux]
* Rails 4.2.4

如何修复这些错误?

【问题讨论】:

  • 感兴趣的是为什么 rails_admin 在查看项目时选择了 0.6.x,它们是 0.8.x .. 但无论如何我只是想建议不要在删除 .lock 后爆破捆绑安装,或者捆绑更新。这会更新所有内容,这可能会破坏事物,并且可能难以追踪。 bundle update 有问题的包可能更安全。
  • 在 Gemfile 中指定 gem rails_admin, '0.8.1' and gem 'jquery-ui-rails', '5.0.1' 然后在删除 Ge,mfile.lock 后尝试捆绑安装

标签: ruby-on-rails ruby rubygems rails-admin ruby-on-rails-4.2


【解决方案1】:

请在此处结帐similar issue。希望能帮助到你。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多