For a RoR installation, is there any way to run rake commands without root access?
To put it another way, is there any way to get db:create and db:migrate to be run without root access (perhaps automatically or something)? Or can I run rake commands from a RoR controller?
Take a look at
rails-2.X.X/lib/tasks/databases.rakeand you can see the code called to create, drop, and migrate your database.Once a
railsenvironment is initialized, you can use the code inside the rake task file to create, drop, and migrate.I do not know if you can do this at the controller level before it errors, but you can always try. You could also do it after
railshas finished initializing in the environment file.config/environment.rb