1
votes

Configuring existing ruby on rails project getting some weird configuration issue - seems like some configuration I'm missing.

I've followed certain steps on my MAC machine as below.

Configure Ruby Environment: => rbenv install 2.4.4 => rbenv local 2.4.4

  1. bundle config set path ~/.bundle
  2. bundle install
  3. npm install
  4. bundle exec rails server -b 0.0.0.0 -p 3001

bundle exec rails server -b 0.0.0.0 -p 3001 casuing serious exception that I'm not able to find the cause.

Exiting
/Users/xxxxxx/.bundle/ruby/2.4.0/gems/deprecated-2.0.1/lib/deprecated.rb:176:in `instance_method': {:sanitize_conditions=>:sanitize_sql} is not a symbol nor a string (TypeError)
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/deprecated-2.0.1/lib/deprecated.rb:176:in `block in '
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/activerecord-5.1.6/lib/active_record/sanitization.rb:32:in `'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/activerecord-5.1.6/lib/active_record/sanitization.rb:5:in `'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/activerecord-5.1.6/lib/active_record/sanitization.rb:2:in `'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/activerecord-5.1.6/lib/active_record/sanitization.rb:1:in `'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `require'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `block in require'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:256:in `block in load_dependency'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:662:in `new_constants_in'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:256:in `load_dependency'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `require'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/activerecord-5.1.6/lib/active_record/base.rb:297:in `'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/activerecord-5.1.6/lib/active_record/base.rb:275:in `'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/activerecord-5.1.6/lib/active_record/base.rb:25:in `'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `require'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `block in require'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:256:in `block in load_dependency'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:662:in `new_constants_in'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:256:in `load_dependency'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `require'
    from /Users/xxxxxx/workspace/my-project/rails/app/models/cloud/entry.rb:2:in `'
    from /Users/xxxxxx/workspace/my-project/rails/app/models/cloud/entry.rb:1:in `'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:477:in `load'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:477:in `block in load_file'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:662:in `new_constants_in'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:476:in `load_file'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:374:in `block in require_or_load'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:36:in `block in load_interlock'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/activesupport-5.1.6/lib/active_support/dependencies/interlock.rb:12:in `block in loading'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/activesupport-5.1.6/lib/active_support/concurrency/share_lock.rb:149:in `exclusive'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/activesupport-5.1.6/lib/active_support/dependencies/interlock.rb:11:in `loading'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:36:in `load_interlock'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:357:in `require_or_load'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:511:in `load_missing_constant'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:202:in `const_missing'
    from /Users/xxxxxx/workspace/my-project/rails/test/factories/cloud/entries.rb:2:in `block in '
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/factory_bot-4.10.0/lib/factory_bot/syntax/default.rb:49:in `instance_eval'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/factory_bot-4.10.0/lib/factory_bot/syntax/default.rb:49:in `run'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/factory_bot-4.10.0/lib/factory_bot/syntax/default.rb:7:in `define'
    from /Users/xxxxxx/workspace/my-project/rails/test/factories/cloud/entries.rb:1:in `'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:286:in `load'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:286:in `block in load'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:258:in `load_dependency'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:286:in `load'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/factory_bot-4.10.0/lib/factory_bot/find_definitions.rb:20:in `block (2 levels) in find_definitions'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/factory_bot-4.10.0/lib/factory_bot/find_definitions.rb:19:in `each'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/factory_bot-4.10.0/lib/factory_bot/find_definitions.rb:19:in `block in find_definitions'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/factory_bot-4.10.0/lib/factory_bot/find_definitions.rb:15:in `each'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/factory_bot-4.10.0/lib/factory_bot/find_definitions.rb:15:in `find_definitions'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/factory_bot_rails-4.10.0/lib/factory_bot_rails/railtie.rb:21:in `block in '
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/activesupport-5.1.6/lib/active_support/lazy_load_hooks.rb:67:in `block in execute_hook'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/activesupport-5.1.6/lib/active_support/lazy_load_hooks.rb:60:in `with_execution_control'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/activesupport-5.1.6/lib/active_support/lazy_load_hooks.rb:65:in `execute_hook'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/activesupport-5.1.6/lib/active_support/lazy_load_hooks.rb:50:in `block in run_load_hooks'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/activesupport-5.1.6/lib/active_support/lazy_load_hooks.rb:49:in `each'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/activesupport-5.1.6/lib/active_support/lazy_load_hooks.rb:49:in `run_load_hooks'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/railties-5.1.6/lib/rails/application/finisher.rb:73:in `block in '
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/railties-5.1.6/lib/rails/initializable.rb:30:in `instance_exec'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/railties-5.1.6/lib/rails/initializable.rb:30:in `run'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/railties-5.1.6/lib/rails/initializable.rb:59:in `block in run_initializers'
    from /Users/xxxxxx/.rbenv/versions/2.4.4/lib/ruby/2.4.0/tsort.rb:228:in `block in tsort_each'
    from /Users/xxxxxx/.rbenv/versions/2.4.4/lib/ruby/2.4.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
    from /Users/xxxxxx/.rbenv/versions/2.4.4/lib/ruby/2.4.0/tsort.rb:431:in `each_strongly_connected_component_from'
    from /Users/xxxxxx/.rbenv/versions/2.4.4/lib/ruby/2.4.0/tsort.rb:349:in `block in each_strongly_connected_component'
    from /Users/xxxxxx/.rbenv/versions/2.4.4/lib/ruby/2.4.0/tsort.rb:347:in `each'
    from /Users/xxxxxx/.rbenv/versions/2.4.4/lib/ruby/2.4.0/tsort.rb:347:in `call'
    from /Users/xxxxxx/.rbenv/versions/2.4.4/lib/ruby/2.4.0/tsort.rb:347:in `each_strongly_connected_component'
    from /Users/xxxxxx/.rbenv/versions/2.4.4/lib/ruby/2.4.0/tsort.rb:226:in `tsort_each'
    from /Users/xxxxxx/.rbenv/versions/2.4.4/lib/ruby/2.4.0/tsort.rb:205:in `tsort_each'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/railties-5.1.6/lib/rails/initializable.rb:58:in `run_initializers'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/railties-5.1.6/lib/rails/application.rb:353:in `initialize!'
    from /Users/xxxxxx/workspace/my-project/rails/config/environment.rb:5:in `'
    from config.ru:3:in `require'
    from config.ru:3:in `block in '
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/rack-2.0.7/lib/rack/builder.rb:55:in `instance_eval'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/rack-2.0.7/lib/rack/builder.rb:55:in `initialize'
    from config.ru:in `new'
    from config.ru:in `'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/rack-2.0.7/lib/rack/builder.rb:49:in `eval'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/rack-2.0.7/lib/rack/builder.rb:49:in `new_from_string'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/rack-2.0.7/lib/rack/builder.rb:40:in `parse_file'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/rack-2.0.7/lib/rack/server.rb:319:in `build_app_and_options_from_config'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/rack-2.0.7/lib/rack/server.rb:219:in `app'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:24:in `app'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/rack-2.0.7/lib/rack/server.rb:354:in `wrapped_app'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:80:in `log_to_stdout'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:42:in `start'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:135:in `block in perform'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:130:in `tap'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:130:in `perform'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/railties-5.1.6/lib/rails/command/base.rb:63:in `perform'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/railties-5.1.6/lib/rails/command.rb:44:in `invoke'
    from /Users/xxxxxx/.bundle/ruby/2.4.0/gems/railties-5.1.6/lib/rails/commands.rb:16:in `'
    from bin/rails:4:in `require'
    from bin/rails:4:in `'
1
The error message says the problem is on line 2 of app/models/cloud/entry.rb. What's there?Tom Lord
I'm not sure what the deprecated gem referenced above is, but if it's this then note that this version was released in 2009; long before ruby 2.4 existed. Maybe this error has happened because you're trying to run the project on a newer ruby version than before?Tom Lord
starting lines of app/models/cloud/entry.rb are >>>>> module Cloud class Entry < ActiveRecord::Base @TomLordshahjapan
I'm guessing you must have changed the version of something, and in doing so introduced this conflict, but I'm not sure what that change is. My best guess is the version of ActiveRecord has been updated, since that change was introduced on an earlier version of rails.Tom Lord
Try to search who uses gem deprecated by keyword depecated in your Gemfile.lock and remove the gem from Gemfile. There should not be gem deprecated in railsitsnikolay

1 Answers

0
votes

Need to remove/upgrade gems having deprecated keyword in my Gemfile.lock by executing command bundle remove $DEPRECATED_GEMS.

In my case there were few deprecated gems like, e.g. dbd_odbc, ruby_odbc

Originally @itsnikolay has provided this solution towards my problem.