When rails g model does not respond when running * When running Rails Introduction # 5 of dot installation from AWS Cloud9

Introductory Rails # 5 for dot installation is a procedure to do in the local environment. https://dotinstall.com/lessons/basic_rails_v3/41805

However, I failed to build the local environment, so when I ran it on AWS cloud9, an error occurred at the stage of ** rails g model **, so I will write a remedy.

environment

Windows10 AWS Cloud9

Event

I typed the command according to the dot installation procedure, but it did not execute even after waiting for a few minutes

teminallog


ec2-user:~/environment/myblog $ rails g model Post title:string body:text

When I cancel with Ctrl + C, I get a log like this

teminallog


ec2-user:~/environment/myblog $ rails g model Post title:string body:text
^CTraceback (most recent call last):
        15: from bin/rails:3:in `<main>'
        14: from bin/rails:3:in `load'
        13: from /home/ec2-user/environment/myblog/bin/spring:15:in `<top (required)>'
        12: from /home/ec2-user/environment/myblog/bin/spring:15:in `require'
        11: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/spring-2.1.1/lib/spring/binstub.rb:11:in `<top (required)>'
        10: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/spring-2.1.1/lib/spring/binstub.rb:11:in `load'
         9: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/spring-2.1.1/bin/spring:49:in `<top (required)>'
         8: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/spring-2.1.1/lib/spring/client.rb:30:in `run'
         7: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/spring-2.1.1/lib/spring/client/command.rb:7:in `call'
         6: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/spring-2.1.1/lib/spring/client/rails.rb:24:in `call'
         5: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/spring-2.1.1/lib/spring/client/command.rb:7:in `call'
         4: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/spring-2.1.1/lib/spring/client/run.rb:35:in `call'
         3: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/spring-2.1.1/lib/spring/client/run.rb:42:in `warm_run'
         2: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/spring-2.1.1/lib/spring/client/run.rb:62:in `run'
         1: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/spring-2.1.1/lib/spring/client/run.rb:117:in `verify_server_version'
/home/ec2-user/.rvm/gems/ruby-2.6.3/gems/spring-2.1.1/lib/spring/client/run.rb:117:in `gets': Interrupt

According to various investigations, it seems that the package written in the Gemfile called ** spring ** may get in the way. So I tried to stop the background processing ** spring ** with the command ** spring stop **

teminallog


ec2-user:~/environment/myblog $ spring stop
Spring stopped.

After that, when I ran ** rails g model **, I got the expected result!

teminallog


ec2-user:~/environment/myblog $ rails g model Post title:string body:text
Running via Spring preloader in process 12505
      invoke  active_record
      create    db/migrate/20201004132353_create_posts.rb
      create    app/models/post.rb
      invoke    test_unit
      create      test/models/post_test.rb
      create      test/fixtures/posts.yml

Recommended Posts

When rails g model does not respond when running * When running Rails Introduction # 5 of dot installation from AWS Cloud9
[Rails] What to do when rails s does not respond or does not stop
Environment construction of Ruby on Rails from 0 [Cloud9] (From Ruby version change to Rails installation)
JavaScript (vanilla) does not respond in Rails.
When @Transactional of Spring Boot does not work