ruby on rails のwindows版での環境構築をProgateというサイトの指示に沿って行っていたのですが
手順として
1.ruby環境を構築
2.sqlite3のインストール
3.rails のインストール
4.rails アプリケーションの作成
5.sqlite3のインストールに失敗したときの対処法
というような流れになっているのですが,現在3までが完了していてrailsアプリケーションの作成の際に
下のようなエラーが生じてしまいます.
エラー文
C:\Users\bachi>rails new sample_App
exist
identical README.md
identical Rakefile
identical .ruby-version
identical config.ru
conflict .gitignore
Overwrite C:/Users/bachi/sample_app/.gitignore? (enter "h" for help) [Ynaqdhm] force .gitignore
identical Gemfile
run git init from "."
Reinitialized existing Git repository in C:/Users/bachi/sample_app/.git/
identical package.json
exist app
identical app/assets/config/manifest.js
identical app/assets/stylesheets/application.css
identical app/channels/application_cable/channel.rb
identical app/channels/application_cable/connection.rb
identical app/controllers/application_controller.rb
identical app/helpers/application_helper.rb
identical app/javascript/channels/consumer.js
identical app/javascript/channels/index.js
identical app/javascript/packs/application.js
identical app/jobs/application_job.rb
identical app/mailers/application_mailer.rb
identical app/models/application_record.rb
identical app/views/layouts/application.html.erb
identical app/views/layouts/mailer.html.erb
identical app/views/layouts/mailer.text.erb
exist app/assets/images
identical app/assets/images/.keep
identical app/controllers/concerns/.keep
identical app/models/concerns/.keep
exist bin
identical bin/rails
identical bin/rake
identical bin/setup
identical bin/yarn
exist config
identical config/routes.rb
identical config/application.rb
identical config/environment.rb
identical config/cable.yml
identical config/puma.rb
identical config/storage.yml
exist config/environments
identical config/environments/development.rb
identical config/environments/production.rb
identical config/environments/test.rb
exist config/initializers
identical config/initializers/application_controller_renderer.rb
identical config/initializers/assets.rb
identical config/initializers/backtrace_silencers.rb
identical config/initializers/content_security_policy.rb
identical config/initializers/cookies_serializer.rb
create config/initializers/cors.rb
identical config/initializers/filter_parameter_logging.rb
identical config/initializers/inflections.rb
identical config/initializers/mime_types.rb
create config/initializers/new_framework_defaults_6_0.rb
identical config/initializers/wrap_parameters.rb
exist config/locales
identical config/locales/en.yml
append .gitignore
identical config/boot.rb
identical config/database.yml
exist db
identical db/seeds.rb
exist lib
exist lib/tasks
identical lib/tasks/.keep
exist lib/assets
identical lib/assets/.keep
exist log
identical log/.keep
exist public
identical public/404.html
identical public/422.html
identical public/500.html
identical public/apple-touch-icon-precomposed.png
identical public/apple-touch-icon.png
identical public/favicon.ico
identical public/robots.txt
exist tmp
identical tmp/.keep
exist tmp/pids
identical tmp/pids/.keep
exist tmp/cache
exist tmp/cache/assets
exist vendor
identical vendor/.keep
exist test/fixtures
identical test/fixtures/.keep
exist test/fixtures/files
identical test/fixtures/files/.keep
exist test/controllers
identical test/controllers/.keep
exist test/mailers
identical test/mailers/.keep
exist test/models
identical test/models/.keep
exist test/helpers
identical test/helpers/.keep
exist test/integration
identical test/integration/.keep
identical test/channels/application_cable/connection_test.rb
identical test/test_helper.rb
exist test/system
identical test/system/.keep
identical test/application_system_test_case.rb
exist storage
identical storage/.keep
exist tmp/storage
identical tmp/storage/.keep
remove config/initializers/cors.rb
remove config/initializers/new_framework_defaults_6_0.rb
run bundle install
Fetching gem metadata from https://rubygems.org/.............
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies....
Using rake 13.0.1
Using concurrent-ruby 1.1.6
Using i18n 1.8.2
Using minitest 5.14.1
Using thread_safe 0.3.6
Using tzinfo 1.2.7
Using zeitwerk 2.3.0
Using activesupport 6.0.3
Using builder 3.2.4
Using erubi 1.9.0
Using mini_portile2 2.4.0
Using nokogiri 1.10.9 (x64-mingw32)
Using rails-dom-testing 2.0.3
Using crass 1.0.6
Using loofah 2.5.0
Using rails-html-sanitizer 1.3.0
Using actionview 6.0.3
Using rack 2.2.2
Using rack-test 1.1.0
Using actionpack 6.0.3
Using nio4r 2.5.2
Using websocket-extensions 0.1.4
Using websocket-driver 0.7.1
Using actioncable 6.0.3
Using globalid 0.4.2
Using activejob 6.0.3
Using activemodel 6.0.3
Using activerecord 6.0.3
Using mimemagic 0.3.5
Using marcel 0.3.3
Using activestorage 6.0.3
Using mini_mime 1.0.2
Using mail 2.7.1
Using actionmailbox 6.0.3
Using actionmailer 6.0.3
Using actiontext 6.0.3
Using public_suffix 4.0.5
Using addressable 2.7.0
Using bindex 0.8.1
Using msgpack 1.3.3 (x64-mingw32)
Using bootsnap 1.4.6
Using bundler 2.1.4
Using byebug 11.1.3
Using regexp_parser 1.7.0
Using xpath 3.2.0
Using capybara 3.32.2
Using childprocess 3.0.0
Using ffi 1.12.2 (x64-mingw32)
Using jbuilder 2.10.0
Using method_source 1.0.0
Using puma 4.3.3
Using rack-proxy 0.6.5
Using thor 1.0.1
Using railties 6.0.3
Using sprockets 4.0.0
Using sprockets-rails 3.2.1
Using rails 6.0.3
Using rubyzip 2.3.0
Using sassc 2.3.0 (x64-mingw32)
Using tilt 2.0.10
Using sassc-rails 2.1.2
Using sass-rails 6.0.0
Using selenium-webdriver 3.142.7
Fetching sqlite3 1.4.2
Installing sqlite3 1.4.2 with native extensions
エラー: 処理を始められませんでした (データベースをロックできません)
エラー: データベースをロックできませんでした: File exists
パッケージマネージャを動かしてないのなら
/var/lib/pacman/db.lck を削除することができます
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory:
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sqlite3-1.4.2/ext/sqlite3
C:/Ruby26-x64/bin/ruby.exe -I C:/Ruby26-x64/lib/ruby/2.6.0 -r
./siteconf20200517-15224-1mq0wma.rb extconf.rb
checking for sqlite3.h... no
sqlite3.h is missing. Install SQLite3 from http://www.sqlite.org/ first.
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/Ruby26-x64/bin/$(RUBY_BASE_NAME)
--with-sqlcipher
--without-sqlcipher
--with-sqlite3-config
--without-sqlite3-config
--with-pkg-config
--without-pkg-config
--with-sqlcipher
--without-sqlcipher
--with-sqlite3-dir
--without-sqlite3-dir
--with-sqlite3-include
--without-sqlite3-include=${sqlite3-dir}/include
--with-sqlite3-lib
--without-sqlite3-lib=${sqlite3-dir}/lib
To see why this extension failed to compile, please check the mkmf.log which can
be found here:
C:/Ruby26-x64/lib/ruby/gems/2.6.0/extensions/x64-mingw32/2.6.0/sqlite3-1.4.2/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sqlite3-1.4.2 for inspection.
Results logged to
C:/Ruby26-x64/lib/ruby/gems/2.6.0/extensions/x64-mingw32/2.6.0/sqlite3-1.4.2/gem_make.out
An error occurred while installing sqlite3 (1.4.2), and Bundler cannot continue.
Make sure that gem install sqlite3 -v '1.4.2' --source 'https://rubygems.org/'
succeeds before bundling.
In Gemfile:
sqlite3
run bundle binstubs bundler
Could not find gem 'sqlite3 (> 1.4) x64-mingw32' in any of the gem sources> 1.4) x64-mingw32' in any of the gem sources listed in your Gemfile.
listed in your Gemfile.
rails webpacker:install
Could not find gem 'sqlite3 (
Run bundle install
to install missing gems.
対処
手順5のsqlite3のインストールがうまくいってないんだなと思って
対処のコマンドを入力しました.
以下入力コマンド
C:\Users\bachi>cd sample_App
C:\Users\bachi\sample_app>ridk exec pacman -S mingw-w64-x86_64-sqlite3
エラー: 処理を始められませんでした (データベースをロックできません)
エラー: データベースをロックできませんでした: File exists
パッケージマネージャを動かしてないのなら
/var/lib/pacman/db.lck を削除することができます
そこでもエラーが発生してしまい以下のサイトを参考
https://7me.oji.0j0.jp/2018/01/12/msys2-pacman-dblck-error/
このサイトに載っているような対処をして,もう一度
ridk exec pacman -S mingw-w64-x86_64-sqlite3
コマンドを入力しても同じエラー文を吐き出されてしまいます
どなたかご親切な方ご教授お願いします
あなたの回答
tips
プレビュー