前提・実現したいこと
rails tutrialをローカル環境で行おうとしています。rubyのバージョンは2.6.3 railsのバージョンは5.1.6です。rails girls(https://railsgirls.jp/install#setup_for_windows)を参考にしてubuntuとwslのインストールを行いました。rails 5.1.6 new twitter実行後、gemファイルを変更後、bundle updateを実行後エラーが発生しました。指示通りgem install byebug -v '9.0.6' --source 'https://rubygems.org/'を実行したところ、再度エラーが発生しました。解決方法をご教授いただければ幸いです。
発生している問題・エラーメッセージ
sk102@DESKTOP-TSRN0CG:~/environment/twitter$ bundle update ... Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /home/sk102/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/byebug-9.0.6/ext/byebug /home/sk102/.rbenv/versions/2.7.1/bin/ruby -I /home/sk102/.rbenv/versions/2.7.1/lib/ruby/2.7.0 -r ./siteconf20200411-15939-1xz9gqs.rb extconf.rb creating Makefile current directory: /home/sk102/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/byebug-9.0.6/ext/byebug make "DESTDIR=" clean current directory: /home/sk102/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/byebug-9.0.6/ext/byebug make "DESTDIR=" compiling breakpoint.c compiling byebug.c compiling context.c context.c: In function ‘call_with_debug_inspector’: context.c:190:20: warning: passing argument 1 of ‘rb_ensure’ from incompatible pointer type [-Wincompatible-pointer-types] return rb_ensure(open_debug_inspector, (VALUE) data, close_debug_inspector, ^~~~~~~~~~~~~~~~~~~~ In file included from /home/sk102/.rbenv/versions/2.7.1/include/ruby-2.7.0/ruby.h:33:0, from byebug.h:4, from context.c:1: /home/sk102/.rbenv/versions/2.7.1/include/ruby-2.7.0/ruby/ruby.h:1990:7: note: expected ‘VALUE (*)(VALUE) {aka long unsigned int (*)(long unsigned int)}’ but argument is of type ‘VALUE (*)(struct call_with_inspection_data *) {aka long unsigned int (*)(struct call_with_inspection_data *)}’ VALUE rb_ensure(VALUE(*)(VALUE),VALUE,VALUE(*)(VALUE),VALUE); ^~~~~~~~~ context.c:190:56: warning: passing argument 3 of ‘rb_ensure’ from incompatible pointer type [-Wincompatible-pointer-types] return rb_ensure(open_debug_inspector, (VALUE) data, close_debug_inspector, ^~~~~~~~~~~~~~~~~~~~~ In file included from /home/sk102/.rbenv/versions/2.7.1/include/ruby-2.7.0/ruby.h:33:0, from byebug.h:4, from context.c:1: /home/sk102/.rbenv/versions/2.7.1/include/ruby-2.7.0/ruby/ruby.h:1990:7: note: expected ‘VALUE (*)(VALUE) {aka long unsigned int (*)(long unsigned int)}’ but argument is of type ‘VALUE (*)(struct call_with_inspection_data *) {aka long unsigned int (*)(struct call_with_inspection_data *)}’ VALUE rb_ensure(VALUE(*)(VALUE),VALUE,VALUE(*)(VALUE),VALUE); ^~~~~~~~~ In file included from /home/sk102/.rbenv/versions/2.7.1/include/ruby-2.7.0/ruby/ruby.h:2148:0, from /home/sk102/.rbenv/versions/2.7.1/include/ruby-2.7.0/ruby.h:33, from byebug.h:4, from context.c:1: context.c: In function ‘Init_context’: /home/sk102/.rbenv/versions/2.7.1/include/ruby-2.7.0/ruby/intern.h:1218:137: warning: passing argument 3 of ‘rb_define_singleton_method1’ from incompatible pointer type [-Wincompatible-pointer-types] #define rb_define_singleton_method(klass, mid, func, arity) rb_define_singleton_method_choose_prototypem3((arity),(func))((klass),(mid),(func),(arity)); ^ context.c:672:3: note: in expansion of macro ‘rb_define_singleton_method’ rb_define_singleton_method(cDebugThread, "inherited", dt_inherited, 1); ^~~~~~~~~~~~~~~~~~~~~~~~~~ /home/sk102/.rbenv/versions/2.7.1/include/ruby-2.7.0/ruby/intern.h:1195:27: note: expected ‘VALUE (*)(VALUE, VALUE) {aka long unsigned int (*)(long unsigned int, long unsigned int)}’ but argument is of type ‘VALUE (*)(VALUE) {aka long unsigned int (*)(long unsigned int)}’ RB_METHOD_DEFINITION_DECL(rb_define_singleton_method, (2,3), (VALUE klass, const char *name), (klass, name)) ^ /home/sk102/.rbenv/versions/2.7.1/include/ruby-2.7.0/ruby/intern.h:1042:82: note: in definition of macro ‘RB_METHOD_DEFINITION_DECL_C’ __attribute__((__unused__,__weakref__(#def),__nonnull__ nonnull))static void defname(RB_UNWRAP_MACRO decl,VALUE(*func)funcargs,int arity); ^~~~~~~ /home/sk102/.rbenv/versions/2.7.1/include/ruby-2.7.0/ruby/intern.h:1075:1: note: in expansion of macro ‘RB_METHOD_DEFINITION_DECL_1’ RB_METHOD_DEFINITION_DECL_1(def,nonnull,def##1 ,1 ,decl,vars,(VALUE,VALUE)) \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/sk102/.rbenv/versions/2.7.1/include/ruby-2.7.0/ruby/intern.h:1195:1: note: in expansion of macro ‘RB_METHOD_DEFINITION_DECL’ RB_METHOD_DEFINITION_DECL(rb_define_singleton_method, (2,3), (VALUE klass, const char *name), (klass, name)) ^~~~~~~~~~~~~~~~~~~~~~~~~ context.c: At top level: cc1: warning: unrecognized command line option ‘-Wno-self-assign’ cc1: warning: unrecognized command line option ‘-Wno-parentheses-equality’ cc1: warning: unrecognized command line option ‘-Wno-constant-logical-operand’ cc1: warning: unrecognized command line option ‘-Wno-cast-function-type’ compiling locker.c compiling threads.c linking shared-object byebug/byebug.so current directory: /home/sk102/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/byebug-9.0.6/ext/byebug make "DESTDIR=" install /usr/bin/install -c -m 0755 byebug.so ./.gem.20200411-15939-hy71ax/byebug Permission denied @ rb_file_s_rename - (./.gem.20200411-15939-hy71ax/byebug, /home/sk102/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/extensions/x86_64-linux/2.7.0/byebug-9.0.6/byebug) Gem files will remain installed in /home/sk102/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/byebug-9.0.6 for inspection. Results logged to /home/sk102/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/extensions/x86_64-linux/2.7.0/byebug-9.0.6/gem_make.out An error occurred while installing byebug (9.0.6), and Bundler cannot continue. Make sure that `gem install byebug -v '9.0.6' --source 'https://rubygems.org/'` succeeds before bundling. In Gemfile: byebug sk102@DESKTOP-TSRN0CG:~/environment/twitter$ gem install byebug -v '9.0.6' --source 'https://rubygems.org/' Building native extensions. This could take a while... ERROR: Error installing byebug: ERROR: Failed to build gem native extension. ...
該当のソースコード
source 'https://rubygems.org' gem 'rails', '5.1.6' gem 'puma', '3.9.1' gem 'sass-rails', '5.0.6' gem 'uglifier', '3.2.0' gem 'coffee-rails', '4.2.2' gem 'jquery-rails', '4.3.1' gem 'turbolinks', '5.0.1' gem 'jbuilder', '2.7.0' group :development, :test do gem 'sqlite3', '1.3.13' gem 'byebug', '9.0.6', platform: :mri end group :development do gem 'web-console', '3.5.1' gem 'listen', '3.1.5' gem 'spring', '2.0.2' gem 'spring-watcher-listen', '2.0.1' end group :test do gem 'rails-controller-testing', '1.0.2' gem 'minitest', '5.10.3' gem 'minitest-reporters', '1.1.14' gem 'guard', '2.16.2' gem 'guard-minitest', '2.4.4' end group :production do gem 'pg', '0.20.0' end # Windows環境ではtzinfo-dataというgemを含める必要があります gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
あなたの回答
tips
プレビュー