Bash: require: command not found


#1

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?


#2

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


#3

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


#4

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


#5

It seems to load the code into a workspace


#6

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


#7

Ruby’s Interactive Ruby Shell