推送到heroku失败:显示不在API或锁定文件中的依赖项

时间:2017-08-26 15:06:54

标签: 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.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堆栈上。我尝试将Geokfile中的nokogiri降级为1.5.9,但由于其他依赖性,它会解析为1.6.0。

感谢任何帮助。

3 个答案:

答案 0 :(得分:1)

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

gem install nokogiri    # step 1
bundle install          # step 2
bundle update           # step 3
bundle install          # step 4
bundle install          # step 5
bundle update           # step 6
git commit -a -m "Fix nokogiri and mini_portile2 problem"    # step 7
git push                # step 8
git push heroku master  # step 9

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

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

我希望这适合你。

-Ben

答案 1 :(得分:1)

1)运行$ sudo apt-get install libsqlite3-dev  如果响应:E:dpkg被中断,则必须手动运行'sudo dpkg --configure -a'来纠正问题。然后运行$ sudo dpkg --configure -a

2)运行$ rails,如果它响应:下载nokogiri-1.10.0揭示了API或锁文件(mini_portile2(〜> 2.4.0))中没有的依赖项。使用--full-index进行安装或运行捆绑软件更新nokogiri都可以解决此问题。

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

答案 2 :(得分:0)

实际上,本杰明的解决方案对我有用。但只是跑步:

$ 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)

With Color, for easier reading