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

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

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

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

Ruby on Rails

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

Ruby on Rails 4

Ruby on Rails4はRubyによって書かれたオープンソースのウェブフレームワークです。 Ruby on Railsは「設定より規約」の原則に従っており、効率的に作業を行うために再開発を行う必要をなくしてくれます。

Q&A

1回答

1769閲覧

Railsでビューとコントローラーを作ろうとしたら次のようなエラーが出ました。

occult_brother

総合スコア9

Ruby

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

Ruby on Rails

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

Ruby on Rails 4

Ruby on Rails4はRubyによって書かれたオープンソースのウェブフレームワークです。 Ruby on Railsは「設定より規約」の原則に従っており、効率的に作業を行うために再開発を行う必要をなくしてくれます。

0グッド

0クリップ

投稿2017/06/23 11:01

ターミナルで、
rails g controller users index show
と入力したら、次のようなエラーが出ました。

Terminal

1Expected string default value for '--rc'; got false (boolean) 2Usage: 3 rails new APP_PATH [options] 4 5Options: 6 -r, [--ruby=PATH] # Path to the Ruby binary of your choice 7 # Default: /Users/soutaando/.rbenv/versions/2.4.0/bin/ruby 8 -m, [--template=TEMPLATE] # Path to some application template (can be a filesystem path or URL) 9 [--skip-gemfile], [--no-skip-gemfile] # Don't create a Gemfile 10 -B, [--skip-bundle], [--no-skip-bundle] # Don't run bundle install 11 -G, [--skip-git], [--no-skip-git] # Skip .gitignore file 12 [--skip-keeps], [--no-skip-keeps] # Skip source control .keep files 13 -O, [--skip-active-record], [--no-skip-active-record] # Skip Active Record files 14 -S, [--skip-sprockets], [--no-skip-sprockets] # Skip Sprockets files 15 [--skip-spring], [--no-skip-spring] # Don't install Spring application preloader 16 -d, [--database=DATABASE] # Preconfigure for selected database (options: mysql/oracle/postgresql/sqlite3/frontbase/ibm_db/sqlserver/jdbcmysql/jdbcsqlite3/jdbcpostgresql/jdbc) 17 # Default: sqlite3 18 -j, [--javascript=JAVASCRIPT] # Preconfigure for selected JavaScript library 19 # Default: jquery 20 -J, [--skip-javascript], [--no-skip-javascript] # Skip JavaScript files 21 [--dev], [--no-dev] # Setup the application with Gemfile pointing to your Rails checkout 22 [--edge], [--no-edge] # Setup the application with Gemfile pointing to Rails repository 23 [--skip-turbolinks], [--no-skip-turbolinks] # Skip turbolinks gem 24 -T, [--skip-test-unit], [--no-skip-test-unit] # Skip Test::Unit files 25 [--rc=RC] # Path to file containing extra configuration options for rails command 26 [--no-rc], [--no-no-rc] # Skip loading of extra configuration options from .railsrc file 27 28Runtime options: 29 -f, [--force] # Overwrite files that already exist 30 -p, [--pretend], [--no-pretend] # Run but do not make any changes 31 -q, [--quiet], [--no-quiet] # Suppress status output 32 -s, [--skip], [--no-skip] # Skip files that already exist 33 34Rails options: 35 -h, [--help], [--no-help] # Show this help message and quit 36 -v, [--version], [--no-version] # Show Rails version number and quit 37 38Description: 39 The 'rails new' command creates a new Rails application with a default 40 directory structure and configuration at the path you specify. 41 42 You can specify extra command-line arguments to be used every time 43 'rails new' runs in the .railsrc configuration file in your home directory. 44 45 Note that the arguments specified in the .railsrc file don't affect the 46 defaults values shown above in this help message. 47 48Example: 49 rails new ~/Code/Ruby/weblog 50 51 This generates a skeletal Rails installation in ~/Code/Ruby/weblog. 52 See the README in the newly created application to get going.

このエラーによって、

app/controllers/users_controller.rb
app/views/users/index.html.erb
app/views/users/show.html.erb

を生成する事ができません。
この場合どのようにすればよろしいでしょうか

railsのバージョンは4.2.7.1です。

参考にしたサイトはこれです。
https://openbook4.me/projects/92/sections/488

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

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

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

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

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

guest

回答1

0

rails new app名
はしましたか?
そのあと生成されたapp名フォルダに移動して
rails g
ができるようになります。

投稿2017/06/23 12:52

moke

総合スコア2241

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

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

ただいまの回答率
85.50%

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

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

質問する

関連した質問