I'm new to Rails. I had created a Rails application earlier and also collected a few data records in the development database. Suppose, I create a new Rails application and I prefer to use the existing development database of the 1st Rails application in my newly created Rails application, how do I do that?
views:
106answers:
3In my database.yml file, I added the entire path as /var/lib/mysql/development because that is where my development database of the previous rails application is present. When I went into the directory of the new rails application and did a rake db:migrate, it gives rake aborted. Incorrect database name. I am not able to find out what is wrong with the database name. If I remove the entire path name, and just mention it as development and then run the server, it says development.locs does not exist.(Here locs is the controller name). Can someone help me find out the solution for this?
mamatha
2010-02-28 04:41:34
A:
your database.yml should look like this:
development:
host: localhost
adapter: mysql
database: your_database_name [just the name, not the path]
username: your_username
password: your_password
test:
...
production:
...
j.
2010-03-01 11:19:24
A:
You need to change the database name in the database.yml file. The seconnd problem you run into is migrations.
I would copy the migrations form your previous application over so that you maintain migration integrity with version numbers and rolling back if that is needed.
Also, if you are seeing development.locs - that locs refers to the table_name, which in restful context is usually also coincidentally the name of the controller.
Apie
2010-03-03 15:01:57