0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【解決済】rails sが起動しなくなった

Last updated at Posted at 2022-10-14

rails sが動かない現象に遭遇したので、備忘録として投稿します。

発生した問題

下記エラーにより、rails sが起動しなくなった。

% rails s
=> Booting Puma
=> Rails 6.1.5 application starting in development 
=> Run `bin/rails server --help` for more startup options
Exiting
bin/rails:7: warning: already initialized constant APP_PATH
/Users/xxxx/workspace/app/bin/rails:7: warning: previous definition of APP_PATH was here
The most common rails commands are:
 generate     Generate new code (short-cut alias: "g")
 console      Start the Rails console (short-cut alias: "c")
 server       Start the Rails server (short-cut alias: "s")
 test         Run tests except system tests (short-cut alias: "t")
 test:system  Run system tests
 dbconsole    Start a console for the database specified in config/database.yml
              (short-cut alias: "db")

 new          Create a new Rails application. "rails new my_app" creates a
              new application called MyApp in "./my_app"


All commands can be run with -h (or --help) for more information.
In addition to those commands, there are:

  about
  action_mailbox:ingress:exim
  action_mailbox:ingress:postfix
〜省略〜
  webpacker:yarn_install
  yarn:install
  zeitwerk:check

原因

原因は、

% bundle config set --local without 'test development'

上記コマンドにより、設定が残ってしまう
というものです。

% bundle install --without test development

上記だと設定が残らない。

確認

% bundle config
Settings are listed in order of priority. The top value will be used.
–delete
Set for the current user (/Users/xxxx/.bundle/config): "without"

without
Set for your local app (/Users/xxxx/workspace/app/.bundle/config): [:test, :development]

–without test developmentが設定されている。

解除

% bundle config --delete without

再確認

% bundle config                 
Settings are listed in order of priority. The top value will be used.
–delete
Set for the current user (/Users/xxxx/.bundle/config): "without"

–withoutが無くなり、rails sも動くようになりました!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?