【问题标题】:Could not find nokogiri-1.11.1 in any of the sources while deploying a heroku app部署 heroku 应用程序时在任何源中找不到 nokogiri-1.11.1
【发布时间】:2021-05-24 06:06:06
【问题描述】:

我在这里的第一篇文章!在将我的 Rails 应用程序部署到 Heroku 时,我收到“在任何来源中都找不到 nokogiri-1.11.1”错误。成功将应用程序推送到我的 git 存储库后,我在运行“git push heroku master”时收到错误消息。我的 ruby​​ 版本是 2.7.2,rails 是 6.1.3,bundler 版本是 2.1.4。谢谢!

remote:        Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4
remote:        The git source `git://github.com/rightscale/right_http_connection.git` uses the `git` protocol, which transmits data without encryption. Disable this warning with `bundle config set git.allow_insecure true`, or switch to the `https` protocol to keep your data secure.
remote:        Some gems seem to be missing from your vendor/cache directory.
remote:        Could not find nokogiri-1.11.1 in any of the sources
remote:        Bundler Output: The git source `git://github.com/rightscale/right_http_connection.git` uses the `git` protocol, which transmits data without encryption. Disable this warning with `bundle config set git.allow_insecure true`, or switch to the `https` protocol to keep your data secure.
remote:        Some gems seem to be missing from your vendor/cache directory.
remote:        Could not find nokogiri-1.11.1 in any of the sources
.
.
.
    remote:  !     Failed to install gems via Bundler.
.
.
.
! [remote rejected] master -> master (pre-receive hook declined)

【问题讨论】:

    标签: ruby-on-rails git heroku ruby-on-rails-6.1


    【解决方案1】:

    这是 Nokogiri 的一个已知问题,因为 Bundler 的默认行为是仅为开发系统而不是生产系统缓存 gem,从而导致部署时出错。

    这可能会解决您的错误。

    rm -rf vendor/cache
    bundle config set force_ruby_platform true
    bundle install
    

    您可以找到更多信息here

    【讨论】:

    • 成功了!谢谢!
    猜你喜欢
    • 2017-12-09
    • 2012-02-17
    • 2014-07-16
    • 1970-01-01
    • 2018-12-25
    • 2017-05-24
    • 2015-07-29
    • 1970-01-01
    • 2012-10-22
    相关资源
    最近更新 更多