質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Ruby on Rails 5

Ruby on Rails 5は、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

Q&A

解決済

1回答

1676閲覧

Railsの導入ができません

montana

総合スコア14

Ruby on Rails 5

Ruby on Rails 5は、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

0グッド

0クリップ

投稿2019/04/14 14:17

編集2019/04/14 21:52

前提・実現したいこと

初心者です。Ruby on Railsを使ってみたいのですが、サーバーを起動しようとrails serverを行うと、sqliteの読み込み部分でエラーが出ます。
OSはwindows10、Rubyは2.6.1、Railsは5.2.3をインストールしています。
sqlite3.exeもインストールできており、pathも通しています。

C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sqlite3-1.3.13-x64-mingw32/lib/sqlite3.rb:4:in `require': cannot load such file -- sqlite3/2.6/sqlite3_native (LoadError)

上記のsqlite3.rbのrequireが機能していないということだと思うのですが、どのようにしたら改善できるでしょうか?

ご回答よろしくお願いいたします。

発生している問題・エラーメッセージ

C:\Users\user\Ruby\todo>rails server Traceback (most recent call last): 21: from bin/rails:4:in `<main>' 20: from bin/rails:4:in `require' 19: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-5.2.3/lib/rails/commands.rb:18:in `<top (required)>' 18: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-5.2.3/lib/rails/command.rb:46:in `invoke' 17: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-5.2.3/lib/rails/command/base.rb:65:in `perform' 16: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch' 15: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command' 14: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run' 13: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:142:in `perform' 12: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:142:in `tap' 11: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:145:in `block in perform' 10: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:145:in `require' 9: from C:/Users/user/Ruby/todo/config/application.rb:7:in `<top (required)>' 8: from C:/Ruby26-x64/lib/ruby/2.6.0/bundler.rb:114:in `require' 7: from C:/Ruby26-x64/lib/ruby/2.6.0/bundler/runtime.rb:65:in `require' 6: from C:/Ruby26-x64/lib/ruby/2.6.0/bundler/runtime.rb:65:in `each' 5: from C:/Ruby26-x64/lib/ruby/2.6.0/bundler/runtime.rb:76:in `block in require' 4: from C:/Ruby26-x64/lib/ruby/2.6.0/bundler/runtime.rb:76:in `each' 3: from C:/Ruby26-x64/lib/ruby/2.6.0/bundler/runtime.rb:81:in `block (2 levels) in require' 2: from C:/Ruby26-x64/lib/ruby/2.6.0/bundler/runtime.rb:81:in `require' 1: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sqlite3-1.3.13-x64-mingw32/lib/sqlite3.rb:4:in `<top (required)>' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sqlite3-1.3.13-x64-mingw32/lib/sqlite3.rb:4:in `require': cannot load such file -- sqlite3/2.6/sqlite3_native (LoadError) 22: from bin/rails:4:in `<main>' 21: from bin/rails:4:in `require' 20: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-5.2.3/lib/rails/commands.rb:18:in `<top (required)>' 19: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-5.2.3/lib/rails/command.rb:46:in `invoke' 18: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-5.2.3/lib/rails/command/base.rb:65:in `perform' 17: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch' 16: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command' 15: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run' 14: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:142:in `perform' 13: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:142:in `tap' 12: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:145:in `block in perform' 11: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:145:in `require' 10: from C:/Users/user/Ruby/todo/config/application.rb:7:in `<top (required)>' 9: from C:/Ruby26-x64/lib/ruby/2.6.0/bundler.rb:114:in `require' 8: from C:/Ruby26-x64/lib/ruby/2.6.0/bundler/runtime.rb:65:in `require' 7: from C:/Ruby26-x64/lib/ruby/2.6.0/bundler/runtime.rb:65:in `each' 6: from C:/Ruby26-x64/lib/ruby/2.6.0/bundler/runtime.rb:76:in `block in require' 5: from C:/Ruby26-x64/lib/ruby/2.6.0/bundler/runtime.rb:76:in `each' 4: from C:/Ruby26-x64/lib/ruby/2.6.0/bundler/runtime.rb:81:in `block (2 levels) in require' 3: from C:/Ruby26-x64/lib/ruby/2.6.0/bundler/runtime.rb:81:in `require' 2: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sqlite3-1.3.13-x64-mingw32/lib/sqlite3.rb:2:in `<top (required)>' 1: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sqlite3-1.3.13-x64-mingw32/lib/sqlite3.rb:6:in `rescue in <top (required)>' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sqlite3-1.3.13-x64-mingw32/lib/sqlite3.rb:6:in `require': cannot load such file -- sqlite3/sqlite3_native (LoadError) In Gemfile: sqlite3

該当のソースコード

# support multiple ruby version (fat binaries under windows) begin RUBY_VERSION =~ /(\d+.\d+)/ require "sqlite3/#{$1}/sqlite3_native" rescue LoadError require 'sqlite3/sqlite3_native' end require 'sqlite3/database' require 'sqlite3/version' module SQLite3 # Was sqlite3 compiled with thread safety on? def self.threadsafe?; threadsafe > 0; end end

試したこと

最初にRailsの5.2.2をインストールして、エラーが出たため調べたところsqliteのバージョン指定に不具合があったという記事を見ました。そのためRailsも5.2.3で改めてインストールしました。
newで作成したtodoの中のGemfileの記述を「gem 'sqlite', '~>1.3.6'」と書き直し、
bundle installも問題なく完了しています。

補足情報(FW/ツールのバージョンなど)

ここにより詳細な情報を記載してください。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

shell

1gem uninstall sqlite3 2gem i sqlite3 -v "~> 1.3.6" --platform=ruby

投稿2019/04/14 23:28

asm

総合スコア15147

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

montana

2019/04/15 11:23

解決しました。本当にどうもありがとうございます!たった2コマンドで起動できるとは思いませんでした。感謝しかありません!
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問