what does || do? If you have a and b then a || b
is true if and only if either a or b is true. It is the same with ||= this operator combines two operations '=' and '||'. So a ||= b
is equivelent to c || c = b
EDIT: so in your context ENV['ENVIRONMENT'] ||= 'test' means that if ENV['ENVIRONMENT'] is not nil and not false it will preserve its value, otherwise it will become 'test' and after that the new value of ENV['ENVIRONMENT'] is assigned to RACK_ENV