我一直在尝试将我的Rails应用程序从5.1.0rc1迁移到5.1.0。
这是我的宝石文件:
Exception in thread "main" java.io.IOException: can't find class file
MyClass.class in
java.net.URLClassLoader{urls=[file:/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre/lib/rt.jar],
parent=gnu.gcj.runtime.SystemClassLoader{urls=[file:./], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}}
at gnu.classpath.tools.javah.Main.getClass(libgcj-tools.so.14)
at gnu.classpath.tools.javah.Main.parseClasses(libgcj-tools.so.14)
at gnu.classpath.tools.javah.Main.run(libgcj-tools.so.14)
at gnu.classpath.tools.javah.Main.main(libgcj-tools.so.14)
这是我从捆绑安装中获得的:
gem 'rails', '~> 5.1.0'
gem 'mysql2', '>= 0.3.18', '< 0.5'
gem 'puma', '~> 3.0'
gem 'sass-rails', '~> 5.0'
gem 'turbolinks', '~> 5'
gem 'uglifier', '>= 1.3.0'
gem 'redis', '~> 3.3.3'
gem 'redis-rails', '~> 5.0.1'
gem 'jbuilder', '~> 2.5'
gem 'sidekiq', '~> 4.2.10'
gem 'active_model_serializers', '~> 0.10.5'
gem 'jwt', '~> 1.5.6'
gem "mini_magick", '~> 4.7.0'
gem 'rack-cors', "~> 0.4.1"
gem 'mandrill-api', "~> 1.0.53"
gem 'curb', "~> 0.9.3"
gem 'inherited_resources', '~> 1.7'
gem 'activeadmin', '~> 1.0.0'
gem 'coffee-rails', '~> 4.2.1'
gem 'therubyracer', git: 'https://github.com/cowboyd/therubyracer.git'
gem 'meta-tags', '~> 2.4.0'
gem 'slim', '~> 3.0.7'
可能出现什么问题?
如果它有帮助(但我怀疑),我在Docker容器上工作。我删除了Bundler could not find compatible versions for gem "actionpack":
In Gemfile:
active_model_serializers (~> 0.10.5) was resolved to 0.10.5, which depends on
actionpack (< 6, >= 4.1)
activeadmin (~> 1.0.0) was resolved to 1.0.0, which depends on
formtastic (~> 3.1) was resolved to 3.1.5, which depends on
actionpack (>= 3.2.13)
activeadmin (~> 1.0.0) was resolved to 1.0.0, which depends on
inherited_resources (~> 1.7) was resolved to 1.7.0, which depends on
actionpack (< 5.1, >= 3.2)
rails (~> 5.1.0) was resolved to 5.1.0, which depends on
actionpack (= 5.1.0)
rails (~> 5.1.0) was resolved to 5.1.0, which depends on
actionpack (= 5.1.0)
rails (~> 5.1.0) was resolved to 5.1.0, which depends on
actionpack (= 5.1.0)
activeadmin (~> 1.0.0) was resolved to 1.0.0, which depends on
ransack (~> 1.3) was resolved to 1.8.2, which depends on
actionpack (>= 3.0)
以避免冲突。
答案 0 :(得分:1)
此处有问题的宝石是inherited_resources
的{{1}},当您提出问题时,其最新版本指定为actionpack (< 5.1, >= 3.2)
。
也许令人惊讶的是,您之前的候选版本的actionpack 5.1.0.rc1
满足< 5.1
约束,因此您无法阻止升级到候选版本,但是已被阻止从最终版本中删除。
新版本的inherited_resources
已于5月3日被删除,这将有固定的内容,但请注意,当前gemspec表示当Rails转到5.2时,您将遇到相同的问题。