Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Push-to-heroku失败:显示的依赖项不在API或锁定文件中_Heroku_Nokogiri_Bundler - Fatal编程技术网

Push-to-heroku失败:显示的依赖项不在API或锁定文件中

Push-to-heroku失败:显示的依赖项不在API或锁定文件中,heroku,nokogiri,bundler,Heroku,Nokogiri,Bundler,我不能推到heroku。 捆绑程序发现了nokogiri 1.6.8.1的未满足依赖项 $ git push heroku master .... remote: The latest bundler is 1.15.4, but you are currently running 1.15.2. remote: To update, run `gem install bundler` remote: Downloading nokogiri-1.6.

我不能推到heroku。 捆绑程序发现了nokogiri 1.6.8.1的未满足依赖项

$ git push heroku master
 ....
remote:        The latest bundler is 1.15.4, but you are currently running 1.15.2.
remote:        To update, run `gem install bundler`
remote:        Downloading nokogiri-1.6.8.1 revealed dependencies not in the API or the
remote:        lockfile (mini_portile2 (~> 2.1.0)).
remote:        Either installing with `--full-index` or running `bundle update nokogiri` should
remote:        fix the problem.
remote:  !
remote:  !     Failed to install gems via Bundler.
remote:  !
remote:  !     Push rejected, failed to compile Ruby app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !       Push rejected to digitreco.
我在Heroku-16系列上。我尝试在Gemfile中将nokogiri降级到1.5.9,但由于其他依赖关系,它解析为1.6.0


感谢您的帮助

我有第二个问题的解决方案(nokogiri和mini_portile2文件不匹配)

步骤2到6是重复的,但我只是通过bash历史回顾我的步骤

我没有你的第一个问题的解决方案,但一旦我解决了第二个问题,第一个问题只是一个警告

我希望这对你有用


-Ben

事实上,本杰明的解决方案对我很有效。但仅仅是跑步:

$ gem install nokogiri

Fetching: mini_portile2-2.3.0.gem (100%)
Successfully installed mini_portile2-2.3.0
Fetching: nokogiri-1.8.2.gem (100%)
Building native extensions.  This could take a while...
Successfully installed nokogiri-1.8.2
2 gems installed


$ bundle update

Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies.....
Using rake 12.3.1
Using concurrent-ruby 1.0.5
Using i18n 1.0.0
Using minitest 5.11.3
Using thread_safe 0.3.6
Using tzinfo 1.2.5
Using activesupport 5.2.0
Using builder 3.2.3
Using erubi 1.7.1
Using mini_portile2 2.3.0
Using nokogiri 1.8.2
Using rails-dom-testing 2.0.3
Using crass 1.0.4
Using loofah 2.2.2
Using rails-html-sanitizer 1.0.4
Using actionview 5.2.0
Using rack 2.0.4
Using rack-test 1.0.0
Using actionpack 5.2.0
Using nio4r 2.3.0
Using websocket-extensions 0.1.3
Using websocket-driver 0.7.0
Using actioncable 5.2.0
Using globalid 0.4.1
Using activejob 5.2.0
Using mini_mime 1.0.0
Using mail 2.7.0
Using actionmailer 5.2.0
Using activemodel 5.2.0
Using arel 9.0.0
Using activerecord 5.2.0
Using mimemagic 0.3.2
Using marcel 0.3.2
Using activestorage 5.2.0
Using public_suffix 3.0.2
Using addressable 2.5.2
Using io-like 0.3.0
Using archive-zip 0.11.0
Using execjs 2.7.0
Using autoprefixer-rails 8.2.0
Using bcrypt 3.1.11
Using bindex 0.5.0
Using msgpack 1.2.4
Using bootsnap 1.3.0
Using popper_js 1.12.9
Using rb-fsevent 0.10.3
Using ffi 1.9.23
Using rb-inotify 0.9.10
Using sass-listen 4.0.0
Using sass 3.5.6
Using bootstrap 4.0.0
Using bundler 1.16.1
Using byebug 10.0.2
Using xpath 3.0.0
Using capybara 3.0.1
Using childprocess 0.9.0
Using chromedriver-helper 1.2.0
Using coffee-script-source 1.12.2
Using coffee-script 2.4.1
Using method_source 0.9.0
Using thor 0.20.0
Using railties 5.2.0
Using coffee-rails 4.2.2
Using temple 0.8.0
Using tilt 2.0.8
Using haml 5.0.4
Using multi_json 1.13.1
Using jbuilder 2.7.0
Using jquery-rails 4.3.1
Using listen 3.1.5
Using pg 1.0.0
Using puma 3.11.3
Using sprockets 3.7.1
Using sprockets-rails 3.2.1
Using rails 5.2.0
Using rubyzip 1.2.1
Using sass-rails 5.0.7
Using selenium-webdriver 3.11.0
Using spring 2.0.2
Using spring-watcher-listen 2.0.1
Using turbolinks-source 5.1.0
Using turbolinks 5.1.1
Using uglifier 4.1.9
Using web-console 3.6.0
Bundle updated!
运行这些命令后,它更改了我的
Gemfile.lock

diff --git a/Gemfile.lock b/Gemfile.lock
index 49818a3..0ad5e64 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -110,11 +110,13 @@ GEM
    method_source (0.9.0)
    mimemagic (0.3.2)
    mini_mime (1.0.0)
    mini_portile2 (2.3.0)
    minitest (5.11.3)
    msgpack (1.2.4)
    multi_json (1.13.1)
    nio4r (2.3.0)
    nokogiri (1.8.2)
      mini_portile2 (~> 2.3.0)
    pg (1.0.0)
    popper_js (1.12.9)
    public_suffix (3.0.2)

1)运行$sudo apt get安装libsqlite3 dev 如果它响应:E:dpkg被中断,则必须手动运行“sudo dpkg--configure-a”以更正该问题。然后运行$sudodpkg--configure-a

2) 如果有响应,请运行$rails:下载nokogiri-1.10.0显示的依赖项不在API或锁文件中(mini_portile2(~>2.4.0))。使用--full index安装或运行bundle update nokogiri都可以解决这个问题

3) 运行$bundle更新nokogiri,一切都将再次完美!
4) 再次启动服务器,瞧

使用gemfury private gem repo遇到了类似的问题。在没有bundler的情况下首先安装gem解决了这个问题,但在移动到另一个环境(例如,在Docker容器或另一台dev机器中安装)时,这并不能解决这个问题
diff --git a/Gemfile.lock b/Gemfile.lock
index 49818a3..0ad5e64 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -110,11 +110,13 @@ GEM
    method_source (0.9.0)
    mimemagic (0.3.2)
    mini_mime (1.0.0)
    mini_portile2 (2.3.0)
    minitest (5.11.3)
    msgpack (1.2.4)
    multi_json (1.13.1)
    nio4r (2.3.0)
    nokogiri (1.8.2)
      mini_portile2 (~> 2.3.0)
    pg (1.0.0)
    popper_js (1.12.9)
    public_suffix (3.0.2)