I have started to learn RoR couple of days back. I am using Aptana
editor for Rails.
I created a new project called users and the database called
users_development. I have added the controller called which is
working. Now I am trying to change the DB from users_development to
scraping_development. I edited the database.yml file from
users_development to scraping_development. Now I tried to run my login
controller. But it is not running it is throwing an error saying that
‘Unknown database scraping_development’.
Can somebody please help me to resolve this problem. I am totally
halted with this problem…
I want to change the Db from users_development to
scraping_development. I dont want my application point to 2 databases.
I want to connet to scraping_development only. Can you please reply me
how I can do that??
and in the Model or any where you want to Use 2nd DB please try with
establish_connection() for 2nd DB.I know i am confucing you a bit please
read here you will get an idea.
I am not able to see any thing in the below link??
and I have one more question. anyway I am not going to use database
“users_development” so why should not I remove the DB entry from the
database.yml file???
I created a new project called users and the database called
users_development. I have added the controller called which is
working. Now I am trying to change the DB from users_development to
scraping_development. I edited the database.yml file from
users_development to scraping_development. Now I tried to run my login
controller. But it is not running it is throwing an error saying that
‘Unknown database scraping_development’.
It is correctly telling you the mysqld (which is outside the editor) has
no
database with that name.
I often create new databases with this magical hack:
echo create database scraping_development; | mysql -u root
If that causes any trouble, just run mysql -u root (or a graphical mysql
administrator) to create a database with that name.
and in the Model or any where you want to Use 2nd DB please try with
establish_connection() for 2nd DB.I know i am confucing you a bit please
read here you will get an idea.
Please read the question again!
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.