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

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

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

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

Ruby on Rails

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

Q&A

解決済

2回答

891閲覧

Railsでconsole, server がうまくいきません

gift-0618

総合スコア22

Ruby

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

Ruby on Rails

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

1グッド

0クリップ

投稿2021/09/19 13:42

やりたこと

 Railsでコンソールやサーバーを立てたい

困っているところ

 ```
rails c / bundle exec rails c

をcmdにたたいても2箇所ほどエラーが起きます ### 環境  Windows10 Home 64bit Ruby 3.0 Rails 6.1.4(最新) ### 説明  はじめに[Ruby on Rails 環境構築のサイト](https://prog-8.com/docs/rails-env-win)をみて、      エラーが出てしまい、次に見たサイトは[Qiitaのエラーの例](https://qiita.com/YumaFuu/items/aa10290e8c48613089a6)で、  他にも、[Qiitaの他のやつ](https://qiita.com/alohaoe/items/9b20a6b549c80991ef21)や、bundle installやupdateをしてみたりと 自分なりに色々試してみたのですが全部ダメでした。 ### エラー内容 #rails s と入力した場合 ![1個目](9bac472569e0ad138b530e1e282be0de.gif) ![2個目](c9d1a9c3274f8e0a2072881058f4a1c3.gif) #bundle exec rails c と入力した場合 ![1個目](bd96504db549bf937b65d070286ed706.gif) ![2個目](d597d847f15ea985c3da5451307bd33e.gif) といった感じです・・・ ### gemfileの中身(アプリ内の)

source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '3.0.2'

Bundle edge Rails instead: gem 'rails', github: 'rails/rails', branch: 'main'

gem 'rails', '~> 6.1.4', '>= 6.1.4.1'

Use sqlite3 as the database for Active Record

gem 'sqlite3', '~> 1.4'

Use Puma as the app server

gem 'puma', '~> 5.0'

Use SCSS for stylesheets

gem 'sass-rails', '>= 6'

Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker

gem 'webpacker', '~> 5.0'

Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks

gem 'turbolinks', '~> 5'

Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder

gem 'jbuilder', '~> 2.7'

Use Redis adapter to run Action Cable in production

gem 'redis', '~> 4.0'

Use Active Model has_secure_password

gem 'bcrypt', '~> 3.1.7'

Use Active Storage variant

gem 'image_processing', '~> 1.2'

Reduces boot times through caching; required in config/boot.rb

gem 'bootsnap', '>= 1.4.4', require: false

group :development, :test do

Call 'byebug' anywhere in the code to stop execution and get a debugger console

gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end

group :development do

Access an interactive console on exception pages or by calling 'console' anywhere in the code.

gem 'web-console', '>= 4.1.0'

Display performance information such as SQL time and flame graphs for each request in your browser.

Can be configured to work on production as well see: https://github.com/MiniProfiler/rack-mini-profiler/blob/master/README.md

gem 'rack-mini-profiler', '~> 2.0'
gem 'rb-readline'    # ここを少し変えました(サイトに書いてあったので)
end

group :test do

Adds support for Capybara system testing and selenium driver

gem 'capybara', '>= 3.26'
gem 'selenium-webdriver'

Easy installation and use of web drivers to run system tests with browsers

gem 'webdrivers'
end

Windows does not include zoneinfo files, so bundle the tzinfo-data gem

gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

42行目あたりをサイトに書いてあった通りに変えました 回答よろしくおねがいします・・・
shinoharat👍を押しています

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

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

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

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

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

guest

回答2

0

ありがとうございます!
教えてもらった通りコマンドを打ったら、

Yarn not installed. Please download and install Yarn from https://yarnpkg.com/lang/en/docs/install/ Exiting!

と、でてきたのでそこのURLに飛んでみたらYarn?をnpm(Node.js)経由でインストールする
コマンドが書いてあったのでそれを打ったところ無事にインストールされ、もう一度できなかった
コマンドを打ったらできました!

そのURLはこちら(コードにも書いてあるけど)→https://classic.yarnpkg.com/en/docs/install/#windows-stable

投稿2021/09/20 06:52

gift-0618

総合スコア22

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

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

0

ベストアンサー

エラーメッセージは画像じゃなくて文字で貼ってもらった方が嬉しいです。

質問への回答ですが、エラーメッセージに Please run rails webpacker:install と出ているので、その通りにすれば良いかと思います。
以下のコマンドを試してください。

rails webpacker:install

投稿2021/09/20 02:05

編集2021/09/20 02:08
shinoharat

総合スコア1680

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

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

gift-0618

2021/09/20 06:47

すみません、本当はテキストでエラーメッセージを書こうとしたんですが文字数オーバーで、 画像にした次第です・・・ そこのエラーの部分だけ書けばよかったですね・・・
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.46%

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

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

質問する

関連した質問