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

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

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

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

Ruby on Rails

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

Q&A

解決済

1回答

391閲覧

rails sで、エラーが出る

kaoru_tujimiya

総合スコア36

Ruby

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

Ruby on Rails

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

0グッド

0クリップ

投稿2018/08/19 14:39

新規で、C:\Users\watak\OneDrive\ドキュメント\rails\に
rails new sample で新規作成して、rails sをしたところ以下のエラーが出ました。
よくわからないので、どなたか教えていただいてもよろしいでしょうか。よろしくお願いします。

Rails 5.2.1
ruby 2.4.4p296 (2018-03-28 revision 63013) [x64-mingw32]

rails

1Usage: 2 rails new APP_PATH [options] 3 4Options: 5 [--skip-namespace], [--no-skip-namespace] # Skip namespace (affects only isolated applications) 6 -r, [--ruby=PATH] # Path to the Ruby binary of your choice 7 # Default: C:/Ruby24-x64/bin/ruby.exe 8 -m, [--template=TEMPLATE] # Path to some application template (can be a filesystem path or URL) 9 -d, [--database=DATABASE] # Preconfigure for selected database (options: mysql/postgresql/sqlite3/oracle/frontbase/ibm_db/sqlserver/jdbcmysql/jdbcsqlite3/jdbcpostgresql/jdbc) 10 # Default: sqlite3 11 [--skip-yarn], [--no-skip-yarn] # Don't use Yarn for managing JavaScript dependencies 12 [--skip-gemfile], [--no-skip-gemfile] # Don't create a Gemfile 13 -G, [--skip-git], [--no-skip-git] # Skip .gitignore file 14 [--skip-keeps], [--no-skip-keeps] # Skip source control .keep files 15 -M, [--skip-action-mailer], [--no-skip-action-mailer] # Skip Action Mailer files 16 -O, [--skip-active-record], [--no-skip-active-record] # Skip Active Record files 17 [--skip-active-storage], [--no-skip-active-storage] # Skip Active Storage files 18 -P, [--skip-puma], [--no-skip-puma] # Skip Puma related files 19 -C, [--skip-action-cable], [--no-skip-action-cable] # Skip Action Cable files 20 -S, [--skip-sprockets], [--no-skip-sprockets] # Skip Sprockets files 21 [--skip-spring], [--no-skip-spring] # Don't install Spring application preloader 22 [--skip-listen], [--no-skip-listen] # Don't generate configuration that depends on the listen gem 23 [--skip-coffee], [--no-skip-coffee] # Don't use CoffeeScript 24 -J, [--skip-javascript], [--no-skip-javascript] # Skip JavaScript files 25 [--skip-turbolinks], [--no-skip-turbolinks] # Skip turbolinks gem 26 -T, [--skip-test], [--no-skip-test] # Skip test files 27 [--skip-system-test], [--no-skip-system-test] # Skip system test files 28 [--skip-bootsnap], [--no-skip-bootsnap] # Skip bootsnap gem 29 [--dev], [--no-dev] # Setup the application with Gemfile pointing to your Rails checkout 30 [--edge], [--no-edge] # Setup the application with Gemfile pointing to Rails repository 31 [--rc=RC] # Path to file containing extra configuration options for rails command 32 [--no-rc], [--no-no-rc] # Skip loading of extra configuration options from .railsrc file 33 [--api], [--no-api] # Preconfigure smaller stack for API only apps 34 -B, [--skip-bundle], [--no-skip-bundle] # Don't run bundle install 35 [--webpack=WEBPACK] # Preconfigure for app-like JavaScript with Webpack (options: react/vue/angular/elm/stimulus) 36 37Runtime options: 38 -f, [--force] # Overwrite files that already exist 39 -p, [--pretend], [--no-pretend] # Run but do not make any changes 40 -q, [--quiet], [--no-quiet] # Suppress status output 41 -s, [--skip], [--no-skip] # Skip files that already exist 42 43Rails options: 44 -h, [--help], [--no-help] # Show this help message and quit 45 -v, [--version], [--no-version] # Show Rails version number and quit 46 47Description: 48 The 'rails new' command creates a new Rails application with a default 49 directory structure and configuration at the path you specify. 50 51 You can specify extra command-line arguments to be used every time 52 'rails new' runs in the .railsrc configuration file in your home directory. 53 54 Note that the arguments specified in the .railsrc file don't affect the 55 defaults values shown above in this help message. 56 57Example: 58 rails new ~/Code/Ruby/weblog 59 60 This generates a skeletal Rails installation in ~/Code/Ruby/weblog.

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

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

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

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

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

guest

回答1

0

ベストアンサー

rails new sample で作成されたディレクトリへ移動してから、再度 rails s を実行してみてください。以下は、アプリケーション名が hoge の場合の例です:

rails new hoge cd hoge rails s

それでも rails s が実行できない場合、以下を試してみてください。

  • bundle install --path=./vendor/bundle
  • bin/rails s

投稿2018/08/19 23:44

sutonea

総合スコア207

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

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

kaoru_tujimiya

2018/08/20 12:34

bundle install --path=./vendor/bundle を試したところCould not locate Gemfileと表示されました。 ディレクトリはどこでも大丈夫ですか? gemfileがないですよ。と言われているということでしょうか?
sutonea

2018/08/20 22:55

> ディレクトリはどこでも大丈夫ですか? いいえ、`rails new` で作成されたディレクトリの中で実行する必要があります。 上記例でいう `hoge` の中で実行する必要があります。
kaoru_tujimiya

2018/08/22 03:50

ありがとうございます。 やはりCould not locate Gemfileとでました。
sutonea

2018/08/22 15:24

なぜですかね... Windows固有の問題だったりするのでしょうか... 実行記録を確認したいので、貼り付けていただけますか?
kaoru_tujimiya

2018/09/02 06:34

ご連絡遅れて申し訳ございません、一度Rubyなどを全削除いたしました。 もしかしたらバージョンの問題とかもあるのでしょうか? さしつかえ無ければ今適しているRubyとRailsのバージョンを教えていただけたら幸いです。 mysqlなども使いたいのですが調べてもよくわからなくて、、 申し訳ないですがよろしくお願いします。
kaoru_tujimiya

2018/09/02 07:09

Ruby ruby 2.4.4p296 (2018-03-28 revision 63013) [x64-mingw32] rails Rails 5.2.1 このバージョンでインストールして,やったらなぜかできました。 いろいろ助言を下さりありがとうございました。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.50%

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

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

質問する

関連した質問