1
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 5 years have passed since last update.

rails console が起動できない

Last updated at Posted at 2018-07-24

rails tutorial に取り組んでいるのですが
第4章{4.2.1}でrails consoleが起動できず困っています。
https://railstutorial.jp/chapters/rails_flavored_ruby?version=5.1#cha-rails_flavored_ruby

Cloud9上でrails console を入力すると

ec2-user:~/environment/sample_app (rails-flavored-ruby) $ rails c
Running via Spring preloader in process 8213
Loading development environment (Rails 5.1.4)
/usr/local/rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/irb/init.rb:24:in `setup': Undefined prompt mode(SAMPLE). (IRB::UndefinedPromptMode)
        from /usr/local/rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/irb.rb:378:in `start'
        from /usr/local/rvm/gems/ruby-2.4.1/gems/railties-5.1.4/lib/rails/commands/console/console_command.rb:62:in `start'
        from /usr/local/rvm/gems/ruby-2.4.1/gems/railties-5.1.4/lib/rails/commands/console/console_command.rb:17:in `start'
        from /usr/local/rvm/gems/ruby-2.4.1/gems/railties-5.1.4/lib/rails/commands/console/console_command.rb:97:in `perform'
        from /usr/local/rvm/gems/ruby-2.4.1@global/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
        from /usr/local/rvm/gems/ruby-2.4.1@global/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
        from /usr/local/rvm/gems/ruby-2.4.1@global/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
        from /usr/local/rvm/gems/ruby-2.4.1/gems/railties-5.1.4/lib/rails/command/base.rb:63:in `perform'
        from /usr/local/rvm/gems/ruby-2.4.1/gems/railties-5.1.4/lib/rails/command.rb:44:in `invoke'
        from /usr/local/rvm/gems/ruby-2.4.1/gems/railties-5.1.4/lib/rails/commands.rb:16:in `<top (required)>'
        from /usr/local/rvm/gems/ruby-2.4.1/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
        from /usr/local/rvm/gems/ruby-2.4.1/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `block in require'
        from /usr/local/rvm/gems/ruby-2.4.1/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency'
        from /usr/local/rvm/gems/ruby-2.4.1/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
        from /home/ec2-user/environment/sample_app/bin/rails:9:in `<top (required)>'
        from /usr/local/rvm/gems/ruby-2.4.1/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:286:in `load'
        from /usr/local/rvm/gems/ruby-2.4.1/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:286:in `block in load'
        from /usr/local/rvm/gems/ruby-2.4.1/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency'
        from /usr/local/rvm/gems/ruby-2.4.1/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:286:in `load'
        from /usr/local/rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /usr/local/rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from -e:1:in `<main>'

上記のように表示されます。

一度spring stop を実行し、再度rails consoleを試しても同様の結果でした。
補足のspring statusです。

ec2-user:~/environment/sample_app (rails-flavored-ruby) $ spring status
Spring is running:

 8072 spring server | sample_app | started 40 mins ago                                    
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQ
 8075 spring app    | sample_app | started 40 mins ago | development mode  

どなたかアドバイスいただければ幸いです。

1
0
2

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
1
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?