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

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

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

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

Q&A

解決済

2回答

2507閲覧

http://localhost:3000で「Yay!You're on Rails!」が開けません。

SBFC

総合スコア10

Ruby on Rails 5

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

1グッド

1クリップ

投稿2018/12/14 02:16

編集2018/12/14 06:26

前提・実現したいこと

一日で基本が身に付く!ruby on railsを見ながら環境を整えている途中で、rails new sampleを入れると
下記のようなメッセージが示され、中断しております。
ファイル名を入れて実行するとsampleファイルはあります。

VS Codeを開き、
Overwrite C:/Users/sbfc2/sample/.gitignore? (enter "h" for help) [Ynaqdhm]
hを入力しましたが、同じコードの繰り返しです。

rails sを入れてみると
Your Ruby version is 2.5.3, but your Gemfile specified 2.5.1

your Gemfile specified 2.5.1が一致しないという意味でとらえました。

rails new sampleを実行し、railsアプリに必要なファイルを新規作成させ、cdコマンドで配置したディレクトリに移動。
bundlerによってrealsアプリと追加で必要なRubyGemsも合わせてインストールを完成させたいのです。
また、Your Ruby version is 2.5.3, but your Gemfile specified 2.5.1をどう対処したらようかを調査中でした。

しかしながら、sampleフォルダがPS C:\Users\sbfc2\上で見つかったため、削除。
rails new sampleは無事インストール完了し、Rails sはエラー
C:/Ruby25/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require': cannot load such file -- sqlite3/sqlite3_native (LoadError)
が出てhttp://localhost:3000で「Yay!You're on Rails!」が開けません。

rails s

=> Booting WEBrick
=> Rails 3.0.7 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
と表示する方法

ご指導くださると幸いです。ぜひよろしくお願いいたします。

ruby on railsで日記を作成
■■な機能を実装中に以下のエラーメッセージが発生しました。

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

PS C:\Users\sbfc2> rails new sample
exist
identical README.md
identical Rakefile
identical .ruby-version
identical config.ru
conflict .gitignore
Overwrite C:/Users/sbfc2/sample/.gitignore? (enter "h" for help) [Ynaqdhm]

無事完了後、

PS C:\Users\sbfc2\sample> rails s
Traceback (most recent call last):
43: from bin/rails:4:in <main>' 42: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in require'
41: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in load_dependency' 40: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in block in require'
39: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in require' 38: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in require_with_bootsnap_lfi'
37: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in register' 36: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in block in require_with_bootsnap_lfi'
35: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in require' 34: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/railties-5.2.2/lib/rails/commands.rb:18:in <top (required)>'
33: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/railties-5.2.2/lib/rails/command.rb:46:in invoke' 32: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/railties-5.2.2/lib/rails/command/base.rb:65:in perform'
31: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor.rb:387:in dispatch' 30: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in invoke_command'
29: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/command.rb:27:in run' 28: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:142:in perform'
27: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:142:in tap' 26: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:145:in block in perform'
25: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in require' 24: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in load_dependency'
23: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in block in require' 22: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in require'
21: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in require_with_bootsnap_lfi' 20: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in register'
19: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in block in require_with_bootsnap_lfi' 18: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in require'
17: from C:/Users/sbfc2/sample/config/application.rb:7:in <top (required)>' 16: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/bundler-1.17.2/lib/bundler.rb:114:in require'
15: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/bundler-1.17.2/lib/bundler/runtime.rb:65:in require' 14: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/bundler-1.17.2/lib/bundler/runtime.rb:65:in each'
13: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/bundler-1.17.2/lib/bundler/runtime.rb:76:in block in require' 12: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/bundler-1.17.2/lib/bundler/runtime.rb:76:in each'
11: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/bundler-1.17.2/lib/bundler/runtime.rb:81:in block (2 levels) in require' 10: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in require'
9: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in require_with_bootsnap_lfi' 8: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in register'
7: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in block in require_with_bootsnap_lfi' 6: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in require'
5: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/sqlite3-1.3.13-x86-mingw32/lib/sqlite3.rb:2:in <top (required)>' 4: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/sqlite3-1.3.13-x86-mingw32/lib/sqlite3.rb:6:in rescue in <top (required)>'
3: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in require' 2: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in load_dependency'
1: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in block in require' C:/Ruby25/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in require': cannot load such file -- sqlite3/sqlite3_native (LoadError)

該当のソースコード

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

PS C:\Users\sbfc2> cd sample
PS C:\Users\sbfc2\sample> rails s
Your Ruby version is 2.5.3, but your Gemfile specified 2.5.1

試したこと

rails s
Your Ruby version is 2.5.3, but your Gemfile specified 2.5.1の問題なのかgoogleで検索しながら
調査中です。

sampleフォルダがPS C:\Users\sbfc2\上で見つかったため、削除。
rails new sampleは無事インストール完了し、
Rails sは

C:/Ruby25/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require': cannot load such file -- sqlite3/sqlite3_native (LoadError)

で、
http://localhost:3000で「Yay!You're on Rails!」が開けません。

Ruby,MSYS32,を消去し、Rubyのバージョン2.5.1を探しましたが、
Ruby 2.5.3-1 (x64)
Ruby 2.5.3-1 (x86)
Ruby 2.4.5-1 (x64)
Ruby 2.4.5-1 (x86)
Ruby 2.3.3
Ruby 2.3.3 (x64)
Ruby 2.2.6
Ruby 2.2.6 (x64)
Ruby 2.1.9
Ruby 2.1.9 (x64)

Rubyのバージョン2.5.1はありませんでした。

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

windows10 pro 32bit

ruby 2.5.3p105 (2018-10-18 revision 65156) [i386-mingw32]
Rails 5.2.2  38 gem installed
SQLite 3.26.0 2018-12-01 12:34:55 bf8c1b2b7a5960c282e543b9c293686dccff272512d08865f4600fb58238b4f9
MSYS2 32bit
bundlerインストール完了

DrqYuto👍を押しています

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

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

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

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

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

guest

回答2

0

自己解決

2018/12/16時点のOS widows10 pro 32biでは、Ruby 2.4.5-1 (x86) をインストールするとrailsも問題なく終了し、「Yay!You're on Rails!」を開くことができます。

投稿2018/12/16 05:46

SBFC

総合スコア10

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

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

0

単純にRubyのバージョンが合っていないのだけかと思うのですが、いかがでしょうか?
Windowsのことはあまりわからないのですが、、。

Rubyのバージョンを2.5.1にしたらどうなりますか?

投稿2018/12/14 04:22

kenny_sayama

総合スコア1036

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

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

SBFC

2018/12/14 05:47

ご回答ありがとうございます。すべて削除し、Rubyのバージョンを2.5.1してみます。ありがとうございます。
SBFC

2018/12/14 06:14

Ruby 2.5.3-1 (x64) Ruby 2.5.3-1 (x86) Ruby 2.4.5-1 (x64) Ruby 2.4.5-1 (x86) Ruby 2.3.3 Ruby 2.3.3 (x64) Ruby 2.2.6 Ruby 2.2.6 (x64) Ruby 2.1.9 Ruby 2.1.9 (x64) Rubyのバージョン2.5.1はありませんでした。 すべて消去はしております。
SBFC

2018/12/14 23:29

情報頂きありがとうございます。早速試してみます。
SBFC

2018/12/15 09:49

ご情報頂いた手順でMSYS2をインストールしておりますが、下記の通り6時間以上経過しておりますが、終了しません。エラーもあります。中断し、消去した方がよろしいでしょうか。 MSYS2 seems to be unavailable Verify integrity of msys2-i686-20180531.exe ... OK Run the MSYS2 installer ... > C:\Users\sbfc2\AppData\Local\Temp/msys2-i686-20180531.exe > sh -lc true Success Remove catgets to avoid conflicts while update ... > pacman -Rdd catgets libcatgets --noconfirm エラー: 対象が見つかりませんでした: catgets エラー: 対象が見つかりませんでした: libcatgets MSYS2 system update (optional) part 1 ... > pacman -Syu --needed --noconfirm :: パッケージデータベースの同期中... 省略 (26/68) 更新 info [#########################################] 100% (27/68) 更新 libp11-kit [#########################################] 100% (28/68) 更新 p11-kit [#########################################] 100% (29/68) 更新 ca-certificates [#########################################] 100% (30/68) インストール brotli [#########################################] 100% (31/68) 更新 libsqlite [######################################---] 95%
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問