using Rails root in seeds.rb

In my seeds.rb, I'm doing some file upload cleanup and want to access RAILS_ROOT but doesn't seem to work. Calling:

puts RAILS_ROOT 

doesn't work. How would I access this?

puts Rails.root

does work

Answers


RAILS_ROOT is deprecated - you should use Rails.root instead


Need Your Help

How to access Activity UI from my class?

android android-context

I have an activity which creates an object instance of my class:

What's the correct way to try a method again after a exception has been handled?

java exception

I am new to exceptions, haven't covered them in college yet so still learning about them. I tried this and it seems to work, but doesn't seem "right". What's the correct way to try a method again a...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.