OWASP / railsgoat

A vulnerable version of Rails that follows the OWASP Top 10
railsgoat.cktricky.com
MIT License
858 stars 666 forks source link

Command 'db:setup' not recognized" #413

Open Daigham opened 3 years ago

Daigham commented 3 years ago

When I type rails db:setup, I get below output. Also on below output there is an error message which says ": Command 'db:setup' not recognized" /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-1.15.3/lib/bundler/shared_helpers.rb:25: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.

/usr/local/rvm/gems/ruby-3.0.0/gems/bundler-1.15.3/lib/bundler/shared_helpers.rb:108: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.

/usr/local/rvm/gems/ruby-3.0.0/gems/bundler-1.15.3/lib/bundler/shared_helpers.rb:108: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.

/usr/local/rvm/gems/ruby-3.0.0/gems/bundler-1.15.3/lib/bundler/shared_helpers.rb:25: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.

/usr/local/rvm/gems/ruby-3.0.0/gems/bundler-1.15.3/lib/bundler/shared_helpers.rb:25: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.

/usr/local/rvm/gems/ruby-3.0.0/gems/bundler-1.15.3/lib/bundler/shared_helpers.rb:34: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.

/usr/local/rvm/gems/ruby-3.0.0/gems/bundler-1.15.3/lib/bundler/shared_helpers.rb:25: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.

/usr/local/rvm/gems/ruby-3.0.0/gems/bundler-1.15.3/lib/bundler/shared_helpers.rb:108: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.

/usr/local/rvm/gems/ruby-3.0.0/gems/bundler-1.15.3/lib/bundler/shared_helpers.rb:108: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.

/usr/local/rvm/gems/ruby-3.0.0/gems/bundler-1.15.3/lib/bundler/shared_helpers.rb:25: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.

/usr/local/rvm/gems/ruby-3.0.0/gems/bundler-1.15.3/lib/bundler/shared_helpers.rb:25: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.

/usr/local/rvm/gems/ruby-3.0.0/gems/bundler-1.15.3/lib/bundler/shared_helpers.rb:34: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.

Error: Command 'db:setup' not recognized

Usage: rails COMMAND [ARGS]

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")

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"

In addition to those, there are:

destroy Undo code generated with "generate" (short-cut alias: "d")

plugin new Generates skeleton for developing a Rails plugin

runner Run a piece of code in the application environment (short-cut alias: "r")

All commands can be run with -h (or --help) for more information.

🐞 Problem Also when I run the command rails server, I get below output: /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-1.15.3/lib/bundler/shared_helpers.rb:25: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.

/usr/local/rvm/gems/ruby-3.0.0/gems/bundler-1.15.3/lib/bundler/shared_helpers.rb:108: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.

/usr/local/rvm/gems/ruby-3.0.0/gems/bundler-1.15.3/lib/bundler/shared_helpers.rb:108: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.

/usr/local/rvm/gems/ruby-3.0.0/gems/bundler-1.15.3/lib/bundler/shared_helpers.rb:25: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.

/usr/local/rvm/gems/ruby-3.0.0/gems/bundler-1.15.3/lib/bundler/shared_helpers.rb:25: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.

/usr/local/rvm/gems/ruby-3.0.0/gems/bundler-1.15.3/lib/bundler/shared_helpers.rb:34: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.

/usr/local/rvm/gems/ruby-3.0.0/gems/bundler-1.15.3/lib/bundler/shared_helpers.rb:25: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.

/usr/local/rvm/gems/ruby-3.0.0/gems/bundler-1.15.3/lib/bundler/shared_helpers.rb:108: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.

/usr/local/rvm/gems/ruby-3.0.0/gems/bundler-1.15.3/lib/bundler/shared_helpers.rb:108: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.

/usr/local/rvm/gems/ruby-3.0.0/gems/bundler-1.15.3/lib/bundler/shared_helpers.rb:25: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.

/usr/local/rvm/gems/ruby-3.0.0/gems/bundler-1.15.3/lib/bundler/shared_helpers.rb:25: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.

/usr/local/rvm/gems/ruby-3.0.0/gems/bundler-1.15.3/lib/bundler/shared_helpers.rb:34: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.

/usr/local/rvm/gems/ruby-3.0.0/gems/activesupport-4.2.8/lib/active_support/core_ext/object/duplicable.rb:111:in <class:BigDecimal>': undefined methodnew' for BigDecimal:Class (NoMethodError)

from /usr/local/rvm/gems/ruby-3.0.0/gems/activesupport-4.2.8/lib/active_support/core_ext/object/duplicable.rb:106:in `<top (required)>'

from /usr/local/rvm/gems/ruby-3.0.0/gems/activesupport-4.2.8/lib/active_support/core_ext/object.rb:3:in `require'

from /usr/local/rvm/gems/ruby-3.0.0/gems/activesupport-4.2.8/lib/active_support/core_ext/object.rb:3:in `<top (required)>'

from /usr/local/rvm/gems/ruby-3.0.0/gems/railties-4.2.8/lib/rails/configuration.rb:2:in `require'

from /usr/local/rvm/gems/ruby-3.0.0/gems/railties-4.2.8/lib/rails/configuration.rb:2:in `<top (required)>'

from /usr/local/rvm/gems/ruby-3.0.0/gems/railties-4.2.8/lib/rails/railtie.rb:2:in `require'

from /usr/local/rvm/gems/ruby-3.0.0/gems/railties-4.2.8/lib/rails/railtie.rb:2:in `<top (required)>'

from /usr/local/rvm/gems/ruby-3.0.0/gems/railties-4.2.8/lib/rails/engine.rb:1:in `require'

from /usr/local/rvm/gems/ruby-3.0.0/gems/railties-4.2.8/lib/rails/engine.rb:1:in `<top (required)>'

from /usr/local/rvm/gems/ruby-3.0.0/gems/railties-4.2.8/lib/rails/application.rb:7:in `require'

from /usr/local/rvm/gems/ruby-3.0.0/gems/railties-4.2.8/lib/rails/application.rb:7:in `<top (required)>'

from /usr/local/rvm/gems/ruby-3.0.0/gems/railties-4.2.8/lib/rails.rb:11:in `require'

from /usr/local/rvm/gems/ruby-3.0.0/gems/railties-4.2.8/lib/rails.rb:11:in `<top (required)>'

from /usr/local/rvm/gems/ruby-3.0.0/gems/railties-4.2.8/lib/rails/commands/server.rb:4:in `require'

from /usr/local/rvm/gems/ruby-3.0.0/gems/railties-4.2.8/lib/rails/commands/server.rb:4:in `<top (required)>'

from /usr/local/rvm/gems/ruby-3.0.0/gems/railties-4.2.8/lib/rails/commands/commands_tasks.rb:123:in `require'

from /usr/local/rvm/gems/ruby-3.0.0/gems/railties-4.2.8/lib/rails/commands/commands_tasks.rb:123:in `require_command!'

from /usr/local/rvm/gems/ruby-3.0.0/gems/railties-4.2.8/lib/rails/commands/commands_tasks.rb:73:in `server'

from /usr/local/rvm/gems/ruby-3.0.0/gems/railties-4.2.8/lib/rails/commands/commands_tasks.rb:39:in `run_command!'

from /usr/local/rvm/gems/ruby-3.0.0/gems/railties-4.2.8/lib/rails/commands.rb:17:in `<top (required)>'

from script/rails:6:in `require'

from script/rails:6:in `<main>'

Looking for a solution please.

🎯 Goal

πŸ’‘ Possible solutions

πŸ“‹ Steps to solve the problem I tried below command: undle exec rake db:setup but it did not work.