简体   繁体   中英

Where is Rails.root directory?

In my Ruby on Rails project, we are going to save the log in the log folder.

Rails.logger = Logger.new(File.join(Rails.root, 'log', 'server.log'))

But I could not find this log in var/log...

Can you tell me where is the Rails.root??

Rails.root is just where you are storing your code files on the file system, nothing really magical about it. You can go see it with rails c and doing

Rails.root.to_s

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