我已经将一个分支部署到 Heroky,现在我想运行迁移或加载架构,无论哪种方式我都会得到:
Unable to resolve dependency: user requested 'fileutils (= 1.0.2)' (Gem::UnsatisfiableDependencyError)
我尝试重新启动heroku (heroku restart
),然后运行heroku run rake db:schema:load
,但没有任何反应。
我还尝试运行 gem update --default
但没有任何改变。
我正在运行 Rails 5.2、Ruby 2.5.3、Heroku Cedar-14 Stack(已弃用,这可能是导致问题的原因吗?)
有什么想法吗?
Traceback (most recent call last):
20: from /app/vendor/bundle/ruby/2.5.0/bin/rake:23:in `<main>'
19: from /app/vendor/ruby-2.5.3/lib/ruby/2.5.0/rubygems.rb:304:in `activate_bin_path'
18: from /app/vendor/ruby-2.5.3/lib/ruby/2.5.0/rubygems.rb:304:in `synchronize'
17: from /app/vendor/ruby-2.5.3/lib/ruby/2.5.0/rubygems.rb:306:in `block in activate_bin_path'
16: from /app/vendor/ruby-2.5.3/lib/ruby/2.5.0/rubygems.rb:243:in `finish_resolve'
15: from /app/vendor/ruby-2.5.3/lib/ruby/2.5.0/rubygems/request_set.rb:397:in `resolve_current'
14: from /app/vendor/ruby-2.5.3/lib/ruby/2.5.0/rubygems/request_set.rb:385:in `resolve'
13: from /app/vendor/ruby-2.5.3/lib/ruby/2.5.0/rubygems/resolver.rb:188:in `resolve'
12: from /app/vendor/ruby-2.5.3/lib/ruby/2.5.0/rubygems/resolver/molinillo/lib/molinillo/resolver.rb:42:in `resolve'
11: from /app/vendor/ruby-2.5.3/lib/ruby/2.5.0/rubygems/resolver/molinillo/lib/molinillo/resolution.rb:64:in `resolve'
10: from /app/vendor/ruby-2.5.3/lib/ruby/2.5.0/rubygems/resolver/molinillo/lib/molinillo/resolution.rb:106:in `start_resolution'
9: from /app/vendor/ruby-2.5.3/lib/ruby/2.5.0/rubygems/resolver/molinillo/lib/molinillo/resolution.rb:165:in `initial_state'
8: from /app/vendor/ruby-2.5.3/lib/ruby/2.5.0/rubygems/resolver/molinillo/lib/molinillo/delegates/specification_provider.rb:51:in `sort_dependencies'
7: from /app/vendor/ruby-2.5.3/lib/ruby/2.5.0/rubygems/resolver/molinillo/lib/molinillo/delegates/specification_provider.rb:69:in `with_no_such_dependency_error_handling'
6: from /app/vendor/ruby-2.5.3/lib/ruby/2.5.0/rubygems/resolver/molinillo/lib/molinillo/delegates/specification_provider.rb:52:in `block in sort_dependencies'
5: from /app/vendor/ruby-2.5.3/lib/ruby/2.5.0/rubygems/resolver.rb:277:in `sort_dependencies'
4: from /app/vendor/ruby-2.5.3/lib/ruby/2.5.0/rubygems/resolver.rb:277:in `with_index'
3: from /app/vendor/ruby-2.5.3/lib/ruby/2.5.0/rubygems/resolver.rb:277:in `sort_by'
2: from /app/vendor/ruby-2.5.3/lib/ruby/2.5.0/rubygems/resolver.rb:277:in `each'
1: from /app/vendor/ruby-2.5.3/lib/ruby/2.5.0/rubygems/resolver.rb:283:in `block in sort_dependencies'
/app/vendor/ruby-2.5.3/lib/ruby/2.5.0/rubygems/resolver.rb:231:in `search_for': Unable to resolve dependency: user requested 'fileutils (= 1.0.2)' (Gem::UnsatisfiableDependencyError)
最佳答案
我在将bundlder升级到v1.9.9后遇到了这个错误,并通过以下方法解决了它:
sudo gem install bundler -v 1.17.3
如果您安装了多个捆绑程序版本,则可以通过以下方式运行特定版本的 bundle :bundle _1.17.3_ exec rspec
虽然看起来后来的 bundler 版本有很多错误,但拥有一个旧的 bundler 可能效果最好,至少这是我在 Ubuntu 上的。
关于ruby-on-rails - 无法解析依赖关系:用户请求 'fileutils (= 1.0.2)' (Gem::UnsatisfiableDependencyError),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55606304/