我在这里的第一篇文章!我得到一个"无法在任何来源中找到nokogiri-1.11.1";错误,而部署我的Rails应用程序到Heroku。在成功地将应用程序推送到我的git存储库后,当我运行"git push heroku master"时,我收到了错误。我的ruby版本是2.7.2,rails版本是6.1.3,捆绑器版本是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)
这是Nokogiri的一个已知问题,因为Bundler的默认行为是只为开发系统缓存gem,而不是为生产系统缓存gem,这会导致在部署时出现错误。
这可能会解决你的错误。
rm -rf vendor/cache
bundle config set force_ruby_platform true
bundle install
你可以在这里找到更多信息。