前提・実現したいこと ruby on rails 環境構築
ruby on rails を実行できる環境を作りたいだけです。簡潔に言うと。
下記を実行した際にでたエラーです
$ rails new rails_app
エラーの原因となっている場所からのコードです。
Fetching sqlite3 1.4.0
Installing sqlite3 1.4.0 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory:
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sqlite3-1.4.0/ext/sqlite3
C:/Ruby24-x64/bin/ruby.exe -r ./siteconf20190412-18544-1clzw17.rb extconf.rb
*** 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:/Ruby24-x64/bin/$(RUBY_BASE_NAME)
--with-sqlcipher
--without-sqlcipher
--with-sqlite3-config
--without-sqlite3-config
--with-pkg-config
--without-pkg-config
C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:457:in try_do': The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first. from C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:542:in
try_link0'
from C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:557:in try_link' from C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:659:in
try_ldflags'
from C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:1819:in pkg_config' from extconf.rb:35:in
<main>'
To see why this extension failed to compile, please check the mkmf.log which can
be found here:
C:/Ruby24-x64/lib/ruby/gems/2.4.0/extensions/x64-mingw32/2.4.0/sqlite3-1.4.0/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sqlite3-1.4.0 for inspection.
Results logged to
C:/Ruby24-x64/lib/ruby/gems/2.4.0/extensions/x64-mingw32/2.4.0/sqlite3-1.4.0/gem_make.out
An error occurred while installing sqlite3 (1.4.0), and Bundler cannot continue.
Make sure that gem install sqlite3 -v '1.4.0' --source 'https://rubygems.org/'
succeeds before bundling.
In Gemfile:
sqlite3
発生している問題・エラーメッセージ
mkmf.log の内容↓
"pkg-config --exists sqlite3"
| pkg-config --libs sqlite3
=> "-LC:/Ruby24-x64/msys64/mingw64/lib -lsqlite3\n"
"x86_64-w64-mingw32-gcc -o conftest.exe -IC:/Ruby24-x64/include/ruby-2.4.0/x64-mingw32 -IC:/Ruby24-x64/include/ruby-2.4.0/ruby/backward -IC:/Ruby24-x64/include/ruby-2.4.0 -I. -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -march=x86-64 -mtune=generic -O2 -pipe conftest.c -L. -LC:/Ruby24-x64/lib -L. -pipe -s -lx64-msvcrt-ruby240 -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
Cannot create temporary file in C:\Users????@~1\AppData\Local\Temp: Invalid argument
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: int main(int argc, char *argv)
6: {
7: return 0;
8: }
/ end */
エラーメッセージ
該当のソースコード
ソースコード
試したこと
PATHは通ってるはずです C:\Ruby24-x64\bin
'https://rubygems.org/' で調べた部分は No gem found と返されました。
様々なサイト様のrails構築のやり方を参考にさせてもらったので重複してる部分があり、それが原因でエラーを起こしてるのかもしれないです。
Gemfile.lockを削除しました。
補足情報(FW/ツールのバージョンなど)
$ruby -v
ruby 2.4.5p335 (2018-10-18 revision 65137) [x64-mingw32]
$rails -v
Rails 5.2.3
$sqlite3 --version
3.6.20
$vagrant -v
Vagrant 2.2.4
$bundler -v
Bundler version 2.0.1
OSはwindows10 64bit です
あなたの回答
tips
プレビュー