简体   繁体   中英

what is the the difference between #{path} and “#{RAILS_ROOT}”

I know that RAILS_ROOT is the old way of getting Rails.root and that it returns a string while Rails.root returns a Pathname object. I have had issues using RAILS_ROOT before loading the environment. As a quick solution I use #{path} which works and returns also the root path as a tring. I have also noticed that while RAILS_ROOT and Rails.root work as expected on console, #{path} does not.

So what is this #{path} and where does it come from?

To my knowledge there is not a "path" variable set by default. Do a search on your code base for "path" and see where it is being set.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM