macOS Catalina 10.15.5 Rails 6.0.3
I'll write a Rails tutorial and a lot of it. The tutorial is compliant with the 6th edition because I want to get used to 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
Change the description as above and execute $ bundle install --without production
.
However, the following error occurred.
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`
I bundled update spring according to the error, This time an error about puma in the 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.
Run % 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
I did $ bundle install
again, but the following loop.
Even in $ gem list
, it is puma 4.3.4.
As a result of various investigations, refer to the following article. https://qiita.com/aiandrox/items/9389696ebc3cc6d3422e
It seems that it was supported by puma 4.3.6, so changed the Gemfile.
Gemfile
gem 'puma', '4.3.6'
After $ bundle update
$ bundle install
passed without any problem.
Recommended Posts