ruby-on-rails 无法修复包更新或安装后的错误

dl5txlt9  于 2023-05-02  发布在  Ruby
关注(0)|答案(1)|浏览(120)

这是一个旧项目,我正试图重新打开(rails5)
当我运行bundle update时,我有:

➜  leschner_ivan bundle update                                                                                                     [(3.2.2)]
Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.
Fetching gem metadata from https://rubygems.org/........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies..............................
Using rake 13.0.6 (was 13.0.1)
Using CFPropertyList 2.3.6
Using concurrent-ruby 1.2.2 (was 1.1.5)
Using i18n 1.12.0 (was 1.7.0)
Using minitest 5.18.0 (was 5.13.0)
Using thread_safe 0.3.6
Using tzinfo 1.2.11 (was 1.2.6)
Using activesupport 5.2.1
Using builder 3.2.4
Using erubi 1.12.0 (was 1.9.0)
Using mini_portile2 2.8.1 (was 2.4.0)
Using racc 1.6.2
Using nokogiri 1.14.3 (arm64-darwin) (was 1.10.7)
Using rails-dom-testing 2.0.3
Using crass 1.0.6 (was 1.0.5)
Using loofah 2.20.0 (was 2.4.0)
Using rails-html-sanitizer 1.5.0 (was 1.3.0)
Using actionview 5.2.1
Using rack 2.2.6.4 (was 2.0.8)
Using rack-test 2.1.0 (was 1.1.0)
Using actionpack 5.2.1
Using nio4r 2.5.9 (was 2.5.2)
Using websocket-extensions 0.1.5 (was 0.1.4)
Using websocket-driver 0.7.5 (was 0.7.1)
Using actioncable 5.2.1
Using globalid 1.1.0 (was 0.4.2)
Using activejob 5.2.1
Using mini_mime 1.1.2 (was 1.0.2)
Using date 3.3.3
Using timeout 0.3.2
Using net-protocol 0.2.1
Using net-imap 0.3.4
Using net-pop 0.1.2
Using net-smtp 0.3.3
Using mail 2.8.1 (was 2.7.1)
Using actionmailer 5.2.1
Using activemodel 5.2.1
Using arel 9.0.0
Using activerecord 5.2.1
Using mimemagic 0.3.10
Using marcel 0.3.3
Using activestorage 5.2.1
Using public_suffix 5.0.1 (was 4.0.2)
Using addressable 2.8.4 (was 2.7.0)
Using http-accept 1.7.0
Using unf_ext 0.0.8.2 (was 0.0.7.6)
Using unf 0.1.4
Using domain_name 0.5.20190701
Using http-cookie 1.0.5 (was 1.0.3)
Using mime-types-data 3.2023.0218.1 (was 3.2019.1009)
Using mime-types 3.4.1 (was 3.3.1)
Using netrc 0.11.0
Using rest-client 2.1.0
Using aliyun-sdk 0.8.0
Using io-like 0.3.1 (was 0.3.0)
Using archive-zip 0.12.0
Using execjs 2.8.1 (was 2.7.0)
Using autoprefixer-rails 10.4.13.0 (was 9.7.3)
Using babel-source 5.8.35
Using babel-transpiler 0.7.0
Using bcrypt 3.1.18 (was 3.1.13)
Using bindex 0.8.1
Using msgpack 1.7.0 (was 1.3.1)
Using bootsnap 1.16.0 (was 1.4.5)
Using popper_js 1.16.1 (was 1.14.5)
Using rb-fsevent 0.11.2 (was 0.10.3)
Using ffi 1.15.5 (was 1.11.3)
Using rb-inotify 0.10.1
Using sass-listen 4.0.0
Using sass 3.7.4
Using bootstrap 4.1.3
Using bundler 2.1.3
Using byebug 11.1.3 (was 11.0.1)
Using matrix 0.4.2
Using regexp_parser 2.7.0 (was 1.6.0)
Using xpath 3.2.0
Using capybara 3.39.0 (was 3.30.0)
Using ssrf_filter 1.0.8
Using carrierwave 1.3.3 (was 1.3.1)
Using chromedriver-helper 2.1.1
Using coderay 1.1.3 (was 1.1.2)
Using connection_pool 2.4.0 (was 2.2.2)
Using database_cleaner-core 2.0.1
Using database_cleaner-active_record 2.1.0
Using database_cleaner 2.0.2 (was 1.7.0)
Using declarative 0.0.20 (was 0.0.10)
Using orm_adapter 0.5.0
Using method_source 1.0.0 (was 0.9.2)
Using thor 1.2.1 (was 1.0.1)
Using railties 5.2.1
Using responders 3.1.0 (was 3.0.0)
Using warden 1.2.9 (was 1.2.8)
Using devise 4.9.2 (was 4.7.1)
Using diff-lcs 1.5.0 (was 1.3)
Using dotenv 2.8.1 (was 2.7.5)
Using dotenv-rails 2.8.1 (was 2.7.5)
Using dry-inflector 1.0.0 (was 0.2.0)
Using excon 0.99.0 (was 0.71.1)
Using faker 1.9.6
Using faraday-net_http 3.0.2
Using ruby2_keywords 0.0.5
Using faraday 2.7.4 (was 0.17.3)
Using file_validators 3.0.0 (was 2.3.0)
Using fission 0.5.0
Using formatador 0.3.0 (was 0.2.5)
Using fog-core 2.2.4 (was 2.2.0)
Using multi_json 1.15.0 (was 1.14.1)
Using fog-json 1.2.0
Using ipaddress 0.8.3
Using rexml 3.2.5
Using xml-simple 1.1.9 (was 1.1.5)
Using fog-aliyun 0.4.0 (was 0.3.5)
Using fog-xml 0.1.4 (was 0.1.3)
Using fog-atmos 0.1.0
Using fog-aws 3.18.0 (was 3.5.2)
Using fog-brightbox 1.11.0 (was 0.16.1)
Using fog-cloudatcost 0.4.0
Using fog-cloudstack 0.1.0
Using fog-digitalocean 0.4.0
Using fog-dnsimple 2.1.0
Using fog-dynect 0.5.0 (was 0.0.3)
Using fog-ecloud 0.3.0
Using jwt 2.7.0 (was 2.2.1)
Using memoist 0.16.2
Using os 1.1.4 (was 1.0.1)
Using signet 0.17.0 (was 0.12.0)
Using googleauth 1.5.2 (was 0.6.7)
Using httpclient 2.8.3
Using trailblazer-option 0.1.2
Using uber 0.1.0
Using representable 3.2.0 (was 3.0.4)
Using retriable 3.1.2
Using webrick 1.8.1
Using google-apis-core 0.11.0
Fetching google-apis-compute_v1 0.66.0
Installing google-apis-compute_v1 0.66.0
Using google-apis-dns_v1 0.31.0
Using google-apis-iamcredentials_v1 0.17.0
Using google-apis-monitoring_v3 0.43.0
Using google-apis-pubsub_v1 0.35.0
Using google-apis-sqladmin_v1beta4 0.45.0
Using google-apis-storage_v1 0.22.0
Using google-cloud-env 1.6.0
Using fog-google 1.19.0 (was 1.7.1)
Using fog-internet-archive 0.0.2 (was 0.0.1)
Using fog-local 0.8.0 (was 0.6.0)
Using fog-openstack 1.1.0 (was 1.0.10)
Using json 2.6.3 (was 2.3.0)
Fetching ovirt-engine-sdk 4.4.1 (was 4.3.0)
Installing ovirt-engine-sdk 4.4.1 (was 4.3.0) with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/nelly/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/ovirt-engine-sdk-4.4.1/ext/ovirtsdk4c
/Users/nelly/.rbenv/versions/3.2.2/bin/ruby extconf.rb
checking for xml2-config... yes
checking for curl-config... yes
creating Makefile

current directory: /Users/nelly/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/ovirt-engine-sdk-4.4.1/ext/ovirtsdk4c
make DESTDIR\= sitearchdir\=./.gem.20230416-41919-im79vg sitelibdir\=./.gem.20230416-41919-im79vg clean

current directory: /Users/nelly/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/ovirt-engine-sdk-4.4.1/ext/ovirtsdk4c
make DESTDIR\= sitearchdir\=./.gem.20230416-41919-im79vg sitelibdir\=./.gem.20230416-41919-im79vg
compiling ov_error.c
compiling ov_http_client.c
ov_http_client.c:216:29: warning: excess elements in array initializer [-Wexcess-initializers]
        .reserved = { NULL, NULL }
                            ^~~~
/Library/Developer/CommandLineTools/usr/lib/clang/14.0.0/include/stddef.h:89:16: note: expanded from macro 'NULL'
#  define NULL ((void*)0)
               ^~~~~~~~~~
ov_http_client.c:272:39: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32]
    count = INT2NUM(context_ptr->size * context_ptr->nmemb);
            ~~~~~~~ ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
ov_http_client.c:392:33: warning: comparison of integers of different signs: 'long' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
        while (pointer - buffer < length && isspace(*pointer)) {
               ~~~~~~~~~~~~~~~~ ^ ~~~~~~
ov_http_client.c:651:18: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
    ptr->limit = connections;
               ~ ^~~~~~~~~~~
ov_http_client.c:845:71: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
    context_ptr->code = curl_multi_wait(context_ptr->handle, NULL, 0, timeout, NULL);
                        ~~~~~~~~~~~~~~~                               ^~~~~~~
ov_http_client.c:1001:47: warning: incompatible function pointer types passing 'int (VALUE, VALUE, struct curl_slist **)' (aka 'int (unsigned
long, unsigned long, struct curl_slist **)') to parameter of type 'int (*)(VALUE, VALUE, VALUE)' (aka 'int (*)(unsigned long, unsigned long,
unsigned long)') [-Wincompatible-function-pointer-types]
        rb_hash_foreach(request_ptr->headers, ov_http_client_add_header, (VALUE) headers);
                                              ^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/nelly/.rbenv/versions/3.2.2/include/ruby-3.2.0/ruby/internal/intern/hash.h:83:40: note: passing argument to parameter 'func' here
void rb_hash_foreach(VALUE hash, int (*func)(VALUE key, VALUE val, VALUE arg), VALUE arg);
                                       ^
ov_http_client.c:1092:34: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare]
    if (RHASH_SIZE(ptr->pending) < ptr->limit) {
        ~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~
ov_http_client.c:1118:71: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare]
        while (RARRAY_LEN(ptr->queue) > 0 && RHASH_SIZE(ptr->pending) < ptr->limit) {
                                             ~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~
8 warnings generated.
compiling ov_http_request.c
ov_http_request.c:75:29: warning: excess elements in array initializer [-Wexcess-initializers]
        .reserved = { NULL, NULL }
                            ^~~~
/Library/Developer/CommandLineTools/usr/lib/clang/14.0.0/include/stddef.h:89:16: note: expanded from macro 'NULL'
#  define NULL ((void*)0)
               ^~~~~~~~~~
ov_http_request.c:347:77: error: use of undeclared identifier 'rb_cData'
    ov_http_request_class = rb_define_class_under(ov_module, "HttpRequest", rb_cData);
                                                                            ^
1 warning and 1 error generated.
make: *** [ov_http_request.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/nelly/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/ovirt-engine-sdk-4.4.1 for inspection.
Results logged to /Users/nelly/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/extensions/arm64-darwin-21/3.2.0/ovirt-engine-sdk-4.4.1/gem_make.out

An error occurred while installing ovirt-engine-sdk (4.4.1), and Bundler cannot continue.
Make sure that `gem install ovirt-engine-sdk -v '4.4.1' --source 'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  fog was resolved to 2.3.0, which depends on
    fog-ovirt was resolved to 2.0.2, which depends on
      ovirt-engine-sdk

如果我运行gem install ovirt-engine-sdk -v '4.4.1' --source 'https://rubygems.org/'
我有以下错误。..

gem install ovirt-engine-sdk -v '4.4.1' --source 'https://rubygems.org/'                                          [(3.2.2)]
Building native extensions. This could take a while...
ERROR:  Error installing ovirt-engine-sdk:
    ERROR: Failed to build gem native extension.

    current directory: /Users/nelly/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/ovirt-engine-sdk-4.4.1/ext/ovirtsdk4c
/Users/nelly/.rbenv/versions/3.2.2/bin/ruby extconf.rb
checking for xml2-config... yes
checking for curl-config... yes
creating Makefile

current directory: /Users/nelly/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/ovirt-engine-sdk-4.4.1/ext/ovirtsdk4c
make DESTDIR\= sitearchdir\=./.gem.20230416-42051-ofowhj sitelibdir\=./.gem.20230416-42051-ofowhj clean

current directory: /Users/nelly/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/ovirt-engine-sdk-4.4.1/ext/ovirtsdk4c
make DESTDIR\= sitearchdir\=./.gem.20230416-42051-ofowhj sitelibdir\=./.gem.20230416-42051-ofowhj
compiling ov_error.c
compiling ov_http_client.c
ov_http_client.c:216:29: warning: excess elements in array initializer [-Wexcess-initializers]
        .reserved = { NULL, NULL }
                            ^~~~
/Library/Developer/CommandLineTools/usr/lib/clang/14.0.0/include/stddef.h:89:16: note: expanded from macro 'NULL'
#  define NULL ((void*)0)
               ^~~~~~~~~~
ov_http_client.c:272:39: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32]
    count = INT2NUM(context_ptr->size * context_ptr->nmemb);
            ~~~~~~~ ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
ov_http_client.c:392:33: warning: comparison of integers of different signs: 'long' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
        while (pointer - buffer < length && isspace(*pointer)) {
               ~~~~~~~~~~~~~~~~ ^ ~~~~~~
ov_http_client.c:651:18: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
    ptr->limit = connections;
               ~ ^~~~~~~~~~~
ov_http_client.c:845:71: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
    context_ptr->code = curl_multi_wait(context_ptr->handle, NULL, 0, timeout, NULL);
                        ~~~~~~~~~~~~~~~                               ^~~~~~~
ov_http_client.c:1001:47: warning: incompatible function pointer types passing 'int (VALUE, VALUE, struct curl_slist **)' (aka 'int (unsigned long, unsigned long, struct curl_slist **)') to parameter of type 'int (*)(VALUE, VALUE, VALUE)' (aka 'int (*)(unsigned long, unsigned long, unsigned long)') [-Wincompatible-function-pointer-types]
        rb_hash_foreach(request_ptr->headers, ov_http_client_add_header, (VALUE) headers);
                                              ^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/nelly/.rbenv/versions/3.2.2/include/ruby-3.2.0/ruby/internal/intern/hash.h:83:40: note: passing argument to parameter 'func' here
void rb_hash_foreach(VALUE hash, int (*func)(VALUE key, VALUE val, VALUE arg), VALUE arg);
                                       ^
ov_http_client.c:1092:34: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare]
    if (RHASH_SIZE(ptr->pending) < ptr->limit) {
        ~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~
ov_http_client.c:1118:71: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare]
        while (RARRAY_LEN(ptr->queue) > 0 && RHASH_SIZE(ptr->pending) < ptr->limit) {
                                             ~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~
8 warnings generated.
compiling ov_http_request.c
ov_http_request.c:75:29: warning: excess elements in array initializer [-Wexcess-initializers]
        .reserved = { NULL, NULL }
                            ^~~~
/Library/Developer/CommandLineTools/usr/lib/clang/14.0.0/include/stddef.h:89:16: note: expanded from macro 'NULL'
#  define NULL ((void*)0)
               ^~~~~~~~~~
ov_http_request.c:347:77: error: use of undeclared identifier 'rb_cData'
    ov_http_request_class = rb_define_class_under(ov_module, "HttpRequest", rb_cData);
                                                                            ^
1 warning and 1 error generated.
make: *** [ov_http_request.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/nelly/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/ovirt-engine-sdk-4.4.1 for inspection.
Results logged to /Users/nelly/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/extensions/arm64-darwin-21/3.2.0/ovirt-engine-sdk-4.4.1/gem_make.out

如果我运行bundle install

➜  leschner_ivan bundle install                                                                                                    [(3.2.2)]
Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.
Fetching gem metadata from https://rubygems.org/........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
minitest-5.13.0 requires ruby version ~> 2.2, which is incompatible with the current version, ruby 3.2.2p53

这是我的Gemfile

source 'https://rubygems.org'

ruby '3.2.2'

gem 'bootsnap', require: false
gem 'jbuilder', '~> 2.0'
gem 'puma'
gem 'rails', '5.2.1'
gem 'redis'

gem 'autoprefixer-rails'
gem 'bootstrap', '~> 4.1.3'
gem 'sprockets-rails', :require => 'sprockets/railtie'
gem 'font-awesome-sass', '~> 5.0.9'
gem 'sass-rails', '>= 3.2'
gem 'simple_form'
gem 'uglifier'
gem 'webpacker'
gem 'jquery-rails'

gem 'mail_form'
gem 'meta-tags'

gem 'devise' 

gem 'fog'
gem 'carrierwave', '~> 1.2', '>= 1.2.3'
#gem 'mimemagic'
gem 'file_validators'

gem 'react-rails'

gem 'photoswipe-rails'
gem 'faker', '~> 1.9', '>= 1.9.1'

gem 'geocoder'

gem "recaptcha", require: "recaptcha/rails"
gem 'sitemap_generator'

group :development do
  gem 'web-console', '>= 3.3.0'
  #gem 'pg', '~> 1.4', '>= 1.4.6'

end

group :development, :test do
  gem 'rspec-rails', '~> 3.7'
  gem 'launchy'
  gem "chromedriver-helper"
  gem 'selenium-webdriver'
  gem 'database_cleaner'
  gem 'shoulda-matchers', '~> 3.1'
  gem 'capybara'
  #gem 'capybara-webkit'
  gem 'rails-controller-testing'
  gem 'pry-byebug'
  gem 'pry-rails'
  gem 'listen', '~> 3.0.5'
  gem 'spring'
  gem 'spring-watcher-listen', '~> 2.0.0'
  gem 'dotenv-rails'
end

编辑

当我尝试安装Ruby 2时。4.4

rbenv install 2.4.4                                                        [(3.2.2)]
To follow progress, use 'tail -f /var/folders/bh/wbvn20493_s066frg6c2wwx00000gn/T/ruby-build.20230426171026.41848.log' or pass --verbose
Downloading openssl-1.1.1t.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/8dee9b24bdb1dcbf0c3d1e9b02fb8f6bf22165e807f45adeb7c9677536859d3b
Installing openssl-1.1.1t...
Installed openssl-1.1.1t to /Users/nelly/.rbenv/versions/2.4.4

Downloading ruby-2.4.4.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.4.tar.bz2
Installing ruby-2.4.4...

WARNING: ruby-2.4.4 is past its end of life and is now unsupported.
It no longer receives bug fixes or critical security updates.

ruby-build: using readline from homebrew
ruby-build: using libyaml from homebrew

BUILD FAILED (macOS 12.6.5 using ruby-build 20230330)

Inspect or clean up the working tree at /var/folders/bh/wbvn20493_s066frg6c2wwx00000gn/T/ruby-build.20230426171026.41848.J8bKnO
Results logged to /var/folders/bh/wbvn20493_s066frg6c2wwx00000gn/T/ruby-build.20230426171026.41848.log

Last 10 log lines:
../.././include/ruby/ruby.h:1753:56: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                                                       ^
closure.c:263:14: error: implicit declaration of function 'ffi_prep_closure' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    result = ffi_prep_closure(pcl, cif, callback, (void *)self);
             ^
6 warnings and 1 error generated.
make[2]: *** [closure.o] Error 1
make[1]: *** [ext/fiddle/all] Error 2
make: *** [build-ext] Error 2
olmpazwi

olmpazwi1#

你可能很难让一个Rails 5应用程序与Ruby 3一起工作。2.尝试先在较旧的Ruby版本上运行它(然后在升级Ruby之前升级Rails)
Ruby & Rails兼容性表:https://www.fastruby.io/blog/ruby/rails/versions/compatibility-table.html

相关问题