Cloud9 Server Startup Errors with Ruby, Rails Version Upgrade

Asked 2 years ago, Updated 2 years ago, 49 views

When I did the following in the Ruby on Rails app, the server did not start up in the development environment (AWS Cloud9).
When I looked into the error message, I couldn't find a clue and couldn't solve it.

I would be most grateful if you could give me some advice on the possibility of a problem.

Thank you for your cooperation

What was done

Update each version to the following

  • ruby'2.3.4'→ruby'2.5.9'
  • rails'4.2.5'→rails'4.2.8'

Development Environment

AWS Cloud 9

Event

The following error message occurs when the server does not start up in the development environment.

error messages:

Traceback (most recent call last):

        24:from bin/rails:9:in`<main>'

        23:from bin/rails:9:in `require'

        22:from/home/ubuntu/application name/vendor/bundle/ruby/2.5.0/gems/rails-4.2.8/lib/rails/commands.rb:17:in`<top(required)>'

        21:from/home/ubuntu/application name/vendor/bundle/ruby/2.5.0/gems/rails-4.2.8/lib/rails/commands/commands_tasks.rb:39:in`run_command!'

        20:from/home/ubuntu/application name/vendor/bundle/ruby/2.5.0/gems/rails-4.2.8/lib/rails/commands/commands_tasks.rb:75:in`server'

        19:from/home/ubuntu/app name/vendor/bundle/ruby/2.5.0/gems/rails-4.2.8/lib/rails/commands_tasks.rb:75:in`tap'

        18:from/home/ubuntu/application name/vendor/bundle/ruby/2.5.0/gems/rails-4.2.8/lib/rails/commands/commands_tasks.rb:80:in`block in server'

        17:from/home/ubuntu/application name/vendor/bundle/ruby/2.5.0/gems/rails-4.2.8/lib/rails/commands/server.rb:78:in `start'

        16:from/home/ubuntu/application name/vendor/bundle/ruby/2.5.0/gems/rails-4.2.8/lib/rails/commands/server.rb:139:in`log_to_stdout'

        15:from/home/ubuntu/app name/vendor/bundle/ruby/2.5.0/gems/rack-1.6.13/lib/rack/server.rb:337:in`wrapped_app'

        14:from/home/ubuntu/app name/vendor/bundle/ruby/2.5.0/gems/rails-4.2.8/lib/rails/commands/server.rb:61:in`app'

        13:from/home/ubuntu/app name/vendor/bundle/ruby/2.5.0/gems/rack-1.6.13/lib/rack/server.rb:209:in `app'

        12:from/home/ubuntu/app name/vendor/bundle/ruby/2.5.0/gems/rack-1.6.13/lib/rack/server.rb:300:in`build_app_and_options_from_config'

        11:from/home/ubuntu/app name/vendor/bundle/ruby/2.5.0/gems/rack-1.6.13/lib/rack/builder.rb:40:in`parse_file'

        10:from/home/ubuntu/application name/vendor/bundle/ruby/2.5.0/gems/rack-1.6.13/lib/rack/builder.rb:49:in`new_from_string'

         9:from/home/ubuntu/app name/vendor/bundle/ruby/2.5.0/gems/rack-1.6.13/lib/rack/builder.rb:49:in `eval'

         8: from /home/ubuntu/environment/application name/config.ru:in`<main>'

         7: from /home/ubuntu/environment/app name/config.ru:in `new'

         6:from/home/ubuntu/app name/vendor/bundle/ruby/2.5.0/gems/rack-1.6.13/lib/rack/builder.rb:55:in `initialize'

         5:from/home/ubuntu/app name/vendor/bundle/ruby/2.5.0/gems/rack-1.6.13/lib/rack/builder.rb:55:in `instance_eval'

         4:from/home/ubuntu/environment/application name/config.ru:6:in`block in<main>'

         3:from/home/ubuntu/app name/vendor/bundle/ruby/2.5.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:274:in `require'

         2:from/home/ubuntu/app name/vendor/bundle/ruby/2.5.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:240:in`load_dependency'

         1:from/home/ubuntu/app name/vendor/bundle/ruby/2.5.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:274:in`block in require'


/home/ubuntu/application name/vendor/bundle/ruby/2.5.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:274:in `require': no explicit conversion from nil to integer (TypeError)

config.ru:

#This file is used by Rack-based servers to start the application.  
  
require::File.expand_path('../config/environment',__FILE__)  
run Rails.application  
  
require 'gctools/oobgc'  
if defined? (Unicorn::HttpRequest)  
  use GC::OOB::UnicornMiddleware  
end

ruby-on-rails ruby aws-cloud9

2022-09-30 17:51

2 Answers

https://github.com/tmm1/gctools/issues/16

This issue seems to be helpful.
Basically, the author of 'gctools/oobgc' seems to say, "Ruby 2.5 has changed the way GC works, so you can delete this gem."
config.ru Why don't you delete the last four lines?


2022-09-30 17:51

I solved myself.
The rails version seems to have been too low for the ruby version


2022-09-30 17:51

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.