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

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

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

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

Ruby on Rails 6

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

Q&A

解決済

1回答

7104閲覧

rails s にて Usage: rails new APP_PATH [options] エラーが発生し、サーバーを起動できない。

haru_ren

総合スコア48

Ruby

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

Ruby on Rails 6

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

0グッド

0クリップ

投稿2020/11/20 13:23

編集2020/11/20 13:26

現在、railsにてオリジナルアプリを作成中なのですが、表題の通り、rails sをした際、 Usage: rails new APP_PATH [options] が発生し、解決できず、困っております。

コンソール画面(エラー内容)とGemfileの内容を下の方に記載してあります。

ご教授いただけませんでしょうか。
何卒、よろしくお願いいたします。

〜環境〜
・mac os
・ruby -v
ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-darwin19]
・rails -v
Rails 6.0.3.3

〜経緯〜
・ヘッダー作成の為、app/assets/stylesheets/以下のディレクトリを追加、ディレクトリ名変更、コード記述などの作業(本件に関係あるかわかりません)
・gemfileにてgem 'bootsnap', '>= 1.4.2', require: false削除、bundle install後、サーバー切断(command + C)
・作業再開する為にrails sしたらエラー発生。
・カレントディレクトリが開発中のアプリにあることは確認済みです。

コンソール

Usage: rails new APP_PATH [options] Options: [--skip-namespace], [--no-skip-namespace] # Skip namespace (affects only isolated applications) -r, [--ruby=PATH] # Path to the Ruby binary of your choice # Default: /Users/genkihirano/.rbenv/versions/2.6.6/bin/ruby -m, [--template=TEMPLATE] # Path to some application template (can be a filesystem path or URL) -d, [--database=DATABASE] # Preconfigure for selected database (options: mysql/postgresql/sqlite3/oracle/frontbase/ibm_db/sqlserver/jdbcmysql/jdbcsqlite3/jdbcpostgresql/jdbc) # Default: sqlite3 [--skip-gemfile], [--no-skip-gemfile] # Don't create a Gemfile -G, [--skip-git], [--no-skip-git] # Skip .gitignore file [--skip-keeps], [--no-skip-keeps] # Skip source control .keep files -M, [--skip-action-mailer], [--no-skip-action-mailer] # Skip Action Mailer files [--skip-action-mailbox], [--no-skip-action-mailbox] # Skip Action Mailbox gem [--skip-action-text], [--no-skip-action-text] # Skip Action Text gem -O, [--skip-active-record], [--no-skip-active-record] # Skip Active Record files [--skip-active-storage], [--no-skip-active-storage] # Skip Active Storage files -P, [--skip-puma], [--no-skip-puma] # Skip Puma related files -C, [--skip-action-cable], [--no-skip-action-cable] # Skip Action Cable files -S, [--skip-sprockets], [--no-skip-sprockets] # Skip Sprockets files [--skip-spring], [--no-skip-spring] # Don't install Spring application preloader [--skip-listen], [--no-skip-listen] # Don't generate configuration that depends on the listen gem -J, [--skip-javascript], [--no-skip-javascript] # Skip JavaScript files [--skip-turbolinks], [--no-skip-turbolinks] # Skip turbolinks gem -T, [--skip-test], [--no-skip-test] # Skip test files [--skip-system-test], [--no-skip-system-test] # Skip system test files [--skip-bootsnap], [--no-skip-bootsnap] # Skip bootsnap gem [--dev], [--no-dev] # Setup the application with Gemfile pointing to your Rails checkout [--edge], [--no-edge] # Setup the application with Gemfile pointing to Rails repository [--rc=RC] # Path to file containing extra configuration options for rails command [--no-rc], [--no-no-rc] # Skip loading of extra configuration options from .railsrc file [--api], [--no-api] # Preconfigure smaller stack for API only apps -B, [--skip-bundle], [--no-skip-bundle] # Don't run bundle install --webpacker, [--webpack=WEBPACK] # Preconfigure Webpack with a particular framework (options: react, vue, angular, elm, stimulus) [--skip-webpack-install], [--no-skip-webpack-install] # Don't run Webpack install Runtime options: -f, [--force] # Overwrite files that already exist -p, [--pretend], [--no-pretend] # Run but do not make any changes -q, [--quiet], [--no-quiet] # Suppress status output -s, [--skip], [--no-skip] # Skip files that already exist Rails options: -h, [--help], [--no-help] # Show this help message and quit -v, [--version], [--no-version] # Show Rails version number and quit Description: The 'rails new' command creates a new Rails application with a default directory structure and configuration at the path you specify. You can specify extra command-line arguments to be used every time 'rails new' runs in the .railsrc configuration file in your home directory. Note that the arguments specified in the .railsrc file don't affect the defaults values shown above in this help message. Example: rails new ~/Code/Ruby/weblog This generates a skeletal Rails installation in ~/Code/Ruby/weblog.

Gemfile

1source 'https://rubygems.org' 2git_source(:github) { |repo| "https://github.com/#{repo}.git" } 3 4ruby '2.6.6' 5 6gem 'rails', '~> 6.0.3', '>= 6.0.3.3' 7gem 'puma', '~> 4.1' 8gem 'sass-rails', '>= 6' 9gem 'webpacker', '~> 4.0' 10gem 'turbolinks', '~> 5' 11gem 'jbuilder', '~> 2.7' 12gem 'bootstrap' 13gem 'bootsnap', '>= 1.4.2', require: false 14gem 'bootstrap-sass' 15gem 'devise' 16 17group :development, :test do 18 gem 'rails-controller-testing' 19 gem 'rspec-rails' 20 gem 'sqlite3' 21 gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] 22end 23 24group :development do 25 gem 'spring-commands-rspec' 26 gem 'web-console', '>= 3.3.0' 27 gem 'listen', '~> 3.2' 28 gem 'spring' 29 gem 'spring-watcher-listen', '~> 2.0.0' 30end 31 32group :test do 33 gem 'webdrivers' 34 gem 'capybara', '>= 2.15' 35 gem 'selenium-webdriver' 36 gem 'webdrivers' 37end 38 39group :production do 40 gem 'pg' 41end 42 43gem 'tzinfo-data'

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

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

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

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

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

technocore

2020/11/20 14:48

何をしているのか読んでもよくわかりませんが とりあえず、動いていた時の状態にもどせばよいでしょう。 gitでローカルリポジトリにコミットしていれば簡単に変更前状態に戻せるのですが。。。
haru_ren

2020/11/20 15:05

technocoreさん、ご回答ありがとうございます! bundle exec rake app:update:bin コマンドを実行後、正常にサーバーが起動できるようになりました。 gitでコミットした箇所に戻したことがなかったので凄く勉強になりました。 次回から何かエラーが起きたら、正常に動いていたコミットまで戻し、原因追及、改善していこうと思います。
haru_ren

2020/11/20 15:16

もし、宜しければなのですが、technocoreさんの"質問への追記・修正の依頼"を ベストアンサーにできればと思いますので、大変お手数ですが、"回答"でコメント頂けないでしょうか。。。 "質問への追記・修正の依頼"はベストアンサーに選択できない仕様の様で。。。
guest

回答1

0

自己解決

technocoreさん、ご回答ありがとうございます!
bundle exec rake app:update:bin コマンドを実行後、正常にサーバーが起動できるようになりました。

gitでコミットした箇所に戻したことがなかったので凄く勉強になりました。
次回から何かエラーが起きたら、正常に動いていたコミットまで戻し、原因追及、改善していこうと思います。

投稿2020/11/21 15:36

haru_ren

総合スコア48

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問