Pass Rails env as factory

Read the diff :)