在 rails5 中使用 rails_admin 时出错
Error while using rails_admin with rails5
我正在尝试将 rails_admin 与 rails5 应用程序一起使用。 rails_admin 0.8.1 没有工作,因为
Bundler could not find compatible versions for gem "rails": In
snapshot (Gemfile.lock):
rails (= 5.0.0.beta1)
In Gemfile:
rails (< 5.1, >= 5.0.0.beta1)
rails_admin was resolved to 0.8.1, which depends on
rails (~> 4.0)
然后我尝试使用 github 中的最新代码
gem 'rails_admin', git: 'https://github.com/sferik/rails_admin.git'
现在我遇到了相互冲突的机架依赖项。
In snapshot (Gemfile.lock):
rack (= 2.0.0.alpha)
In Gemfile:
rails (< 5.1, >= 5.0.0.beta1) was resolved to 5.0.0.beta1, which depends on
actionmailer (= 5.0.0.beta1) was resolved to 5.0.0.beta1, which depends on
actionpack (= 5.0.0.beta1) was resolved to 5.0.0.beta1, which depends on
rack (~> 2.x)
rails_admin was resolved to 0.8.1, which depends on
rack-pjax (~> 0.7) was resolved to 0.7.0, which depends on
rack (~> 1.3)
rails (< 5.1, >= 5.0.0.beta1) was resolved to 5.0.0.beta1, which depends on
sprockets-rails (>= 2.0.0) was resolved to 3.0.0, which depends on
sprockets (>= 3.0.0) was resolved to 3.5.2, which depends on
rack (< 3, > 1)
devise was resolved to 4.0.0.pre.dev, which depends on
warden (~> 1.2.3) was resolved to 1.2.4, which depends on
rack (>= 1.0)
devise was resolved to 4.0.0.pre.dev, which depends on
warden (~> 1.2.3) was resolved to 1.2.4, which depends on
rack (>= 1.0)
现在开始使用rails5是不是太早了?我应该回到 rails4.2 吗?
我看到 RA 有 Rails5 gemfile https://github.com/sferik/rails_admin/blob/master/gemfiles/rails_5.0.gemfile。我会尝试升级到该文件中提到的所有宝石。
我通过以下方式修复:
gem 'rails_admin', github: 'sferik/rails_admin'
gem 'rack-pjax', github: 'afcapel/rack-pjax'
gem 'remotipart', github: 'mshibuya/remotipart', ref: '3a6acb3'
我正在尝试将 rails_admin 与 rails5 应用程序一起使用。 rails_admin 0.8.1 没有工作,因为
Bundler could not find compatible versions for gem "rails": In snapshot (Gemfile.lock): rails (= 5.0.0.beta1)
In Gemfile: rails (< 5.1, >= 5.0.0.beta1)
rails_admin was resolved to 0.8.1, which depends on rails (~> 4.0)
然后我尝试使用 github 中的最新代码
gem 'rails_admin', git: 'https://github.com/sferik/rails_admin.git'
现在我遇到了相互冲突的机架依赖项。
In snapshot (Gemfile.lock): rack (= 2.0.0.alpha)
In Gemfile: rails (< 5.1, >= 5.0.0.beta1) was resolved to 5.0.0.beta1, which depends on actionmailer (= 5.0.0.beta1) was resolved to 5.0.0.beta1, which depends on actionpack (= 5.0.0.beta1) was resolved to 5.0.0.beta1, which depends on rack (~> 2.x)
rails_admin was resolved to 0.8.1, which depends on rack-pjax (~> 0.7) was resolved to 0.7.0, which depends on rack (~> 1.3) rails (< 5.1, >= 5.0.0.beta1) was resolved to 5.0.0.beta1, which depends on sprockets-rails (>= 2.0.0) was resolved to 3.0.0, which depends on sprockets (>= 3.0.0) was resolved to 3.5.2, which depends on rack (< 3, > 1) devise was resolved to 4.0.0.pre.dev, which depends on warden (~> 1.2.3) was resolved to 1.2.4, which depends on rack (>= 1.0) devise was resolved to 4.0.0.pre.dev, which depends on warden (~> 1.2.3) was resolved to 1.2.4, which depends on rack (>= 1.0)
现在开始使用rails5是不是太早了?我应该回到 rails4.2 吗?
我看到 RA 有 Rails5 gemfile https://github.com/sferik/rails_admin/blob/master/gemfiles/rails_5.0.gemfile。我会尝试升级到该文件中提到的所有宝石。
我通过以下方式修复:
gem 'rails_admin', github: 'sferik/rails_admin'
gem 'rack-pjax', github: 'afcapel/rack-pjax'
gem 'remotipart', github: 'mshibuya/remotipart', ref: '3a6acb3'