前提・実現したいこと
Ruby on Rails初学者です。
以下サイトのMAC OSセットアップに沿ってローカル環境構築を行っています。
https://railsgirls.jp/install
http://localhost:3000
でページ表示させられるようにしたいのですが、以下の各コマンド実行時にエラーが表示されてしまい、進める事ができません。
解決策をご教示いただきたいです。
発生している問題・エラーメッセージ
rails new sample
を実行すると、bundle install
以降で以下エラーメッセージが表示される
create tmp/storage create tmp/storage/.keep remove config/initializers/cors.rb remove config/initializers/new_framework_defaults_6_0.rb run bundle install The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`. There was an error while trying to write to `/Users/kosuke-mac/.bundle/cache/compact_index/rubygems.org.443.29b0360b937aa4d161703e6160654e47/versions`. It is likely that you need to grant write permissions for that path. run bundle binstubs bundler Could not find gem 'rails (~> 6.0.3, >= 6.0.3.2)' in any of the gem sources listed in your Gemfile. run bundle exec spring binstub --all bundler: command not found: spring Install missing gem executables with `bundle install` rails webpacker:install Could not find gem 'rails (~> 6.0.3, >= 6.0.3.2)' in any of the gem sources listed in your Gemfile. Run `bundle install` to install missing gems.
cd sample
で移動し、rails g scaffold book
rails db:migrate
rails server
を実行すると以下メッセージが表示される
Could not find puma-4.3.5 in any of the sources Run `bundle install` to install missing gems.
試したこと
cd sample
で移動した状態で、bundle install
を実行、以下メッセージが表示される
Installing listen 3.2.1 Fetching method_source 1.0.0 Installing method_source 1.0.0 Fetching puma 4.3.5 Installing puma 4.3.5 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /Users/kosuke-mac/test_app/vendor/bundle/ruby/2.6.0/gems/puma-4.3.5/ext/puma_http11 /Users/kosuke-mac/.rbenv/versions/2.6.6/bin/ruby -I /Users/kosuke-mac/.rbenv/versions/2.6.6/lib/ruby/2.6.0 -r ./siteconf20200804-69826-14btqfh.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/kosuke-mac/test_app/vendor/bundle/ruby/2.6.0/gems/puma-4.3.5/ext/puma_http11 make "DESTDIR=" clean current directory: /Users/kosuke-mac/test_app/vendor/bundle/ruby/2.6.0/gems/puma-4.3.5/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/kosuke-mac/test_app/vendor/bundle/ruby/2.6.0/gems/puma-4.3.5 for inspection. Results logged to /Users/kosuke-mac/test_app/vendor/bundle/ruby/2.6.0/extensions/x86_64-darwin-19/2.6.0/puma-4.3.5/gem_make.out An error occurred while installing puma (4.3.5), and Bundler cannot continue. Make sure that `gem install puma -v '4.3.5' --source 'https://rubygems.org/'` succeeds before bundling. In Gemfile: puma
上記メッセージ内に記載のある、gem install puma -v '4.3.5' --source 'https://rubygems.org/'
を実行すると以下メッセージが表示される
Building native extensions. This could take a while... ERROR: Error installing puma: ERROR: Failed to build gem native extension. current directory: /Users/kosuke-mac/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/puma-4.3.5/ext/puma_http11 /Users/kosuke-mac/.rbenv/versions/2.6.6/bin/ruby -I /Users/kosuke-mac/.rbenv/versions/2.6.6/lib/ruby/2.6.0 -r ./siteconf20200804-83190-1flomnr.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/kosuke-mac/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/puma-4.3.5/ext/puma_http11 make "DESTDIR=" clean current directory: /Users/kosuke-mac/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/puma-4.3.5/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/kosuke-mac/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/puma-4.3.5 for inspection. Results logged to /Users/kosuke-mac/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/extensions/x86_64-darwin-19/2.6.0/puma-4.3.5/gem_make.out
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。