Bash: require: command not found


I created a new file sample_user.rb with content of a new class User. When I tried to run "require ‘./example_user’ in the console, I got an error "bash: require: command not found"
Does anyone know why I cannot run require command in the console?


I never heard of the require command. What does it do?


Could it be that you are trying to use the source command ?


Maybe you are trying to run it from ruby repl? in that case run irb command in the terminal before running require './example_user'


It seems to load the code into a workspace


Thanks! That is it. what is irb environment by the way?


Ruby’s Interactive Ruby Shell