macOS Catalina 10.15.5 Rails 6.0.3
J'écrirai le tutoriel Rails et diverses choses qui l'accompagnent. Le tutoriel est compatible avec la 6ème édition car je souhaite m'habituer à Github.
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
Modifiez la description comme ci-dessus et exécutez $ bundle install --without production
.
Cependant, l'erreur suivante s'est produite.
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`
J'ai regroupé le ressort de mise à jour en fonction de l'erreur, mais Cette fois, il y a une erreur concernant puma dans la liste des gemmes.
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.
Exécutez % gem install puma -v 4.3.4
.
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
J'ai refait $ bundle install
, mais la boucle suivante.
Même dans $ gem list
, il s'agit de puma 4.3.4.
À la suite de diverses enquêtes, reportez-vous à l'article suivant. https://qiita.com/aiandrox/items/9389696ebc3cc6d3422e
Il semble qu'il était supporté par puma 4.3.6, donc changé le Gemfile.
Gemfile
gem 'puma', '4.3.6'
Après $ bundle update
$ bundle install
est passé sans aucun problème.
Recommended Posts