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

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

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

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

Q&A

解決済

2回答

2104閲覧

railsの新規アプリ作成におけるエラー

keisuke713

総合スコア25

Ruby on Rails 5

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

0グッド

0クリップ

投稿2019/02/25 03:51

編集2019/02/25 05:16

*つまづいていること
railsで新規アプリを作成しようと以下のコマンドを打つとエラーが出ます。

ruby

1rails _5.2.2 new hello_app

*出てくるエラー

ruby

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

*試したこと

ruby

1bundle exec rake rails:update:bin

を打ち込んだら

ruby

1Could not locate Gemfile or .bundle/ directory

とエラーが出ました。

*環境
ruby 2.6.1p33 (2019-01-30 revision 66950) [x86_64-darwin17]
rails 5.2.2
です。

よろしくお願いします。

*補足
バージョンを指定しなかったら、成功しました。

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

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

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

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

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

guest

回答2

0

bash

$ rails _5.2.2 new hello_app

正しくは

bash

1$ rails _5.2.2_ new hello_app

バージョン指定の最後の_が抜けています。

投稿2019/02/25 04:04

退会済みユーザー

退会済みユーザー

総合スコア0

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

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

keisuke713

2019/02/25 04:56

_を加えても同じエラーが出ます。
退会済みユーザー

退会済みユーザー

2019/02/25 08:15

手元では問題なく作成されるので再現が取れません。
guest

0

自己解決

_とnewの間にspaceを入れる

投稿2019/02/25 23:59

keisuke713

総合スコア25

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

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

退会済みユーザー

退会済みユーザー

2019/02/27 00:12

僕の回答に不備はなかったと思いますが...
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問