ruby-on-rails - 无法解析依赖关系:用户请求 'fileutils (= 1.0.2)' (Gem::UnsatisfiableDependencyError)

标签 ruby-on-rails heroku

我已经将一个分支部署到 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/

相关文章:

ruby-on-rails - 如何将图像上传到我的 heroku 应用程序

ruby-on-rails - 未定义的方法 `get?' 为 302 :Integer

ruby-on-rails - Twitter Bootstrap Rails : How to write semantic HTML by reusing classes?

ruby-on-rails - 在资源管道中预编译 HTML 页面

ruby-on-rails - 使用 ruby​​/savon 生成 wsse-security 的 DigestValue 元素

javascript - Link_to 不渲染自定义 Controller 操作的部分内容

performance - 在 PostgreSQL 上首次加载时查询运行速度非常慢

ruby-on-rails - 问题将数据库迁移到 Heroku - PG::UndefinedTable: ERROR: relation "users"does not exist

python - 我在 Heroku 上的 Django 应用程序中添加了一个 SECRET_KEY 配置变量,但现在它无法在本地运行

java - 在heroku上部署而不保留gradlew文件