macOS Catalina 10.15.5 Rails 6.0.3
Ich werde das Rails-Tutorial und verschiedene dazugehörige Dinge schreiben. Das Tutorial entspricht der 6. Ausgabe, da ich mich an Github gewöhnen möchte.
Gemfile
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
gem 'rails', '6.0.3'
gem 'puma', '4.3.4'
gem 'sass-rails', '5.1.0'
gem 'webpacker', '4.0.7'
gem 'turbolinks', '5.2.0'
gem 'jbuilder', '2.9.1'
gem 'bootsnap', '1.4.5', require: false
group :development, :test do
gem 'sqlite3', '1.4.1'
gem 'byebug', '11.0.1', platforms: [:mri, :mingw, :x64_mingw]
end
group :development do
gem 'web-console', '4.0.1'
gem 'listen', '3.1.5'
gem 'spring', '2.1.0'
gem 'spring-watcher-listen', '2.0.1'
end
group :test do
gem 'capybara', '3.28.0'
gem 'selenium-webdriver', '3.142.4'
gem 'webdrivers', '4.1.2'
end
group :production do
gem 'pg', '1.1.4'
end
Ändern Sie die Beschreibung wie oben und führen Sie "$ bundle install --without Production" aus.
Der folgende Fehler ist jedoch aufgetreten.
You have requested:
spring = 2.1.0
The bundle currently has spring locked at 2.1.1.
Try running `bundle update spring`
If you are updating multiple gems in your Gemfile at once,
try passing them all to `bundle update`
Ich habe Update Spring entsprechend dem Fehler gebündelt, aber Dieses Mal gibt es einen Fehler über Puma in der Gemlist.
An error occurred while installing puma (4.3.4), and Bundler cannot continue.
Make sure that `gem install puma -v '4.3.4' --source 'https://rubygems.org/'` succeeds before
bundling.
Führen Sie % gem install puma -v 4.3.4
aus.
Fetching puma-4.3.4.gem
Building native extensions. This could take a while...
ERROR: Error installing puma:
ERROR: Failed to build gem native extension.
current directory: /Users/user/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/puma-4.3.4/ext/puma_http11
/Users/user/.rbenv/versions/2.7.0/bin/ruby -I /Users/user/.rbenv/versions/2.7.0/lib/ruby/2.7.0 -r ./siteconf20200913-23274-ktgz78.rb extconf.rb
checking for BIO_read() in -lcrypto... yes
checking for SSL_CTX_new() in -lssl... yes
checking for openssl/bio.h... yes
checking for DTLS_method() in openssl/ssl.h... yes
checking for TLS_server_method() in openssl/ssl.h... yes
checking for SSL_CTX_set_min_proto_version in openssl/ssl.h... yes
creating Makefile
current directory: /Users/user/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/puma-4.3.4/ext/puma_http11
make "DESTDIR=" clean
current directory: /Users/user/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/puma-4.3.4/ext/puma_http11
make "DESTDIR="
compiling http11_parser.c
ext/puma_http11/http11_parser.c:44:18: warning: unused variable 'puma_parser_en_main' [-Wunused-const-variable]
static const int puma_parser_en_main = 1;
^
1 warning generated.
compiling io_buffer.c
compiling mini_ssl.c
mini_ssl.c:145:7: warning: unused variable 'min' [-Wunused-variable]
int min, ssl_options;
^
mini_ssl.c:299:40: warning: function 'raise_error' could be declared with attribute 'noreturn' [-Wmissing-noreturn]
void raise_error(SSL* ssl, int result) {
^
2 warnings generated.
compiling puma_http11.c
puma_http11.c:203:22: error: implicitly declaring library function 'isspace' with type 'int (int)' [-Werror,-Wimplicit-function-declaration]
while (vlen > 0 && isspace(value[vlen - 1])) vlen--;
^
puma_http11.c:203:22: note: include the header <ctype.h> or explicitly provide a declaration for 'isspace'
1 error generated.
make: *** [puma_http11.o] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/user/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/puma-4.3.4 for inspection.
Results logged to /Users/user/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/extensions/x86_64-darwin-19/2.7.0/puma-4.3.4/gem_make.out
Ich habe "$ bundle install" erneut ausgeführt, aber die folgende Schleife. Sogar in "$ gem list" ist es Puma 4.3.4.
Aufgrund verschiedener Untersuchungen wird auf den folgenden Artikel verwiesen. https://qiita.com/aiandrox/items/9389696ebc3cc6d3422e
Es scheint, dass es von Puma 4.3.6 unterstützt wurde, also wurde das Gemfile geändert.
Gemfile
gem 'puma', '4.3.6'
Nach $ bundle update
$ bundle install
wurde ohne Probleme bestanden.
Recommended Posts