ที่จริงฉันติดอยู่กับปัญหานี้และฉันได้ลองใช้คำสั่งมากมาย แต่ไม่มีอะไรทำงาน
ฉันพยายามที่จะวิ่ง รางใหม่ new_app -d mysql
แต่เมื่อฉันวิ่ง กำ
ฉันได้รับสิ่งนี้
ไดเรกทอรีปัจจุบัน: /tmp/bundler20211018-12152-wipksimysql2-0.5.3/gems/mysql2-0.5.3/ext/mysql2
/usr/bin/ruby2.7 -I /usr/local/lib/site_ruby/2.7.0 -r ./siteconf20211018-12152-tsd8v4.rb extconf.rb --with-ldflags\=-L/usr/local/ เลือก/openssl/lib
กำลังตรวจสอบ rb_absint_size()... ใช่
กำลังตรวจสอบ rb_absint_singlebit_p()... ใช่
กำลังตรวจสอบ rb_wait_for_single_fd()... ใช่
*** extconf.rb ล้มเหลว ***
ไม่สามารถสร้าง Makefile ได้เนื่องจากเหตุผลบางประการ อาจไม่จำเป็น
ไลบรารีและ/หรือส่วนหัว ตรวจสอบไฟล์ mkmf.log สำหรับรายละเอียดเพิ่มเติม คุณอาจ
ต้องการตัวเลือกการกำหนดค่า
ให้ตัวเลือกการกำหนดค่า:
--กับ-opt-dir
--with-opt-dir
--พร้อมตัวเลือกรวม
--without-opt-include=${opt-dir}/include
--กับ-opt-lib
--without-opt-lib=${opt-dir}/lib
--ด้วย-make-prog
--โดยไม่ต้องทำโปรแกรม
--srcdir=.
--เคอร์ดิร์
--ruby=/usr/bin/$(RUBY_BASE_NAME)2.7
--กับ-mysql-dir
--ไม่มี-mysql-dir
--with-mysql-include
--without-mysql-include=${mysql-dir}/include
--กับ-mysql-lib
--without-mysql-lib=${mysql-dir}/lib
--ด้วย-mysql-config
--ไม่มี-mysql-config
--ด้วย-mysqlclient-dir
--without-mysqlclient-dir
--with-mysqlclient-include
--without-mysqlclient-include=${mysqlclient-dir}/include
--ด้วย-mysqlclient-lib
--without-mysqlclient-lib=${mysqlclient-dir}/lib
--กับ-mysqlclientlib
--ไม่มี-mysqlclientlib
/usr/lib/ruby/2.7.0/mkmf.rb:1050:in `block in find_library': undefined method `split' for nil:NilClass (NoMethodError)
จาก /usr/lib/ruby/2.7.0/mkmf.rb:1050:ใน `รวบรวม'
จาก /usr/lib/ruby/2.7.0/mkmf.rb:1050:ใน `find_library'
จาก extconf.rb:87:ใน `<หลัก>'
หากต้องการทราบสาเหตุที่การคอมไพล์ส่วนขยายนี้ล้มเหลว โปรดตรวจสอบ mkmf.log ซึ่งสามารถพบได้ที่นี่:
/tmp/bundler20211018-12152-wipksimysql2-0.5.3/extensions/x86_64-linux/2.7.0/mysql2-0.5.3/mkmf.log
extconf ล้มเหลว รหัสออก 1
ไฟล์อัญมณีจะยังคงติดตั้งอยู่ใน /tmp/bundler20211018-12152-wipksimysql2-0.5.3/gems/mysql2-0.5.3 เพื่อตรวจสอบ
ผลลัพธ์บันทึกไปที่
/usr/local/lib/site_ruby/2.7.0/rubygems/ext/builder.rb:92:ใน `เรียกใช้'
/usr/local/lib/site_ruby/2.7.0/rubygems/ext/ext_conf_builder.rb:47:in `block in build'
/usr/lib/ruby/2.7.0/tempfile.rb:291:in `เปิด'
/usr/local/lib/site_ruby/2.7.0/rubygems/ext/ext_conf_builder.rb:26:ใน `build'
/usr/local/lib/site_ruby/2.7.0/rubygems/ext/builder.rb:158:ใน `build_extension'
/usr/local/lib/site_ruby/2.7.0/rubygems/ext/builder.rb:192:in `บล็อกใน build_extensions'
/usr/local/lib/site_ruby/2.7.0/rubygems/ext/builder.rb:189:ใน `แต่ละ'
/usr/local/lib/site_ruby/2.7.0/rubygems/ext/builder.rb:189:ใน `build_extensions'
/usr/local/lib/site_ruby/2.7.0/rubygems/installer.rb:837:ใน `build_extensions'
/usr/local/lib/site_ruby/2.7.0/bundler/rubygems_gem_installer.rb:66:ใน `build_extensions'
/usr/local/lib/site_ruby/2.7.0/bundler/rubygems_gem_installer.rb:26:ใน `ติดตั้ง'
/usr/local/lib/site_ruby/2.7.0/bundler/source/rubygems.rb:199:ใน `ติดตั้ง'
/usr/local/lib/site_ruby/2.7.0/bundler/installer/gem_installer.rb:54:ใน `ติดตั้ง'
/usr/local/lib/site_ruby/2.7.0/bundler/installer/gem_installer.rb:59:in `บล็อกใน install_with_settings'
/usr/local/lib/site_ruby/2.7.0/bundler/rubygems_integration.rb:558:ใน `install_with_build_args'
/usr/local/lib/site_ruby/2.7.0/bundler/installer/gem_installer.rb:59:ใน `install_with_settings'
/usr/local/lib/site_ruby/2.7.0/bundler/installer/gem_installer.rb:16:ใน `install_from_spec'
/usr/local/lib/site_ruby/2.7.0/bundler/installer/parallel_installer.rb:186:ใน `do_install'
/usr/local/lib/site_ruby/2.7.0/bundler/installer/parallel_installer.rb:177:in `บล็อกใน worker_pool'
/usr/local/lib/site_ruby/2.7.0/bundler/worker.rb:62:ใน `apply_func'
/usr/local/lib/site_ruby/2.7.0/bundler/worker.rb:57:in `บล็อกใน process_queue'
/usr/local/lib/site_ruby/2.7.0/bundler/worker.rb:54:ใน `ลูป'
/usr/local/lib/site_ruby/2.7.0/bundler/worker.rb:54:ใน `process_queue'
/usr/local/lib/site_ruby/2.7.0/bundler/worker.rb:91:in `บล็อก (2 ระดับ) ใน create_threads'
เกิดข้อผิดพลาดขณะติดตั้ง mysql2 (0.5.3) และ Bundler ไม่สามารถดำเนินการต่อได้
ใน Gemfile:
mysql2
มันเป็น Gemfile ของฉันในไฟล์ new_app มันเป็นเพียงครึ่งหน้า
ทับทิม '2.7.1'
# Bundle edge Rails แทน: gem 'rails', github: 'rails/rails', สาขา: 'main'
อัญมณี 'ราง', '~> 6.1.4', '>= 6.1.4.1'
# ใช้ mysql เป็นฐานข้อมูลสำหรับ Active Record
อัญมณี 'mysql2', '~> 0.5'
# ใช้ Puma เป็นเซิร์ฟเวอร์แอป
อัญมณี 'เสือพูมา', '~> 5.0'
# ใช้ SCSS สำหรับสไตล์ชีต
อัญมณี 'sass-rails', '>= 6'
# JavaScript ที่เหมือนแอพ Transpile อ่านเพิ่มเติม: https://github.com/rails/webpacker
อัญมณี 'webpacker', '~> 5.0'
# Turbolinks ทำให้การนำทางเว็บแอปพลิเคชันของคุณเร็วขึ้น อ่านเพิ่มเติม: https://github.com/turbolinks/turbolinks
อัญมณี 'เทอร์โบลิงค์', '~> 5'
# สร้าง JSON API ได้อย่างง่ายดาย อ่านเพิ่มเติม: https://github.com/rails/jbuilder
อัญมณี 'jbuilder', '~> 2.7'
# ใช้อะแดปเตอร์ Redis เพื่อเรียกใช้ Action Cable ในการผลิต
# อัญมณี 'redis', '~> 4.0'
# ใช้โมเดลที่ใช้งาน has_secure_password
# อัญมณี 'bcrypt', '~> 3.1.7'