fix rails detect