我已经为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)
答案 0 :(得分:2)
将Bunlder升级到v1.9.9后出现此错误,并使用以下命令解决了该问题:
sudo gem install bundler -v 1.17.3
如果安装了多个捆绑软件版本,则可以通过以下方式运行捆绑软件的特定版本:bundle _1.17.3_ exec rspec
尽管似乎以后的捆绑器版本都是错误的,但使用一个旧的捆绑器可能效果最好,至少这是我在Ubuntu上拥有的。
答案 1 :(得分:0)
如果在已弃用的堆栈上运行,则对其进行升级应该可以解决问题