Reputation: 3993
I'm trying to get RoR installed on my Ubuntu install and have it running with MySql. RoR and MySql have both installed fine and working but I'm having problems getting rails to work with MySql following this tutorial: http://wiki.rubyonrails.org/getting-started/installation/linux
To test your Rails installation, generate a new Rails project:
$ rails myrailsapp
If you are using MySQL, use the following command:
$ rails myrailsapp -d mysql
Now I know that you now have to type rails new [appname] not just rails [appname] to get this working once this is done and project is created its still using the sqlite3 databse so I run the next line $ rails myrailsapp -d mysql when I do this I just get a large list of text giving me various options with out changing anything.
What have I done wrong?
Upvotes: 0
Views: 407
Reputation: 2093
Welcome aboard @twigg to the Rails world =).
First of all, you have to specify your Rails version you installed. If your Rails version < 3 then you can create a new project by simply running the command rails my_app_name
. If you are using Rails > 3 then to create a new project just run the following command rails new my_app_name
. This command will create a bunch of files one of them is the database.yml where you can configure you database parameters (adapter, username, password and database name).
If you are using Rails with MySQL, then to create a project configured with MySQL, just run the command rails my_app_name -d mysql
in Rails < 3 or rails new my_app_name -d mysql
Don't forget to install the adapter of the database which is in your case (MySQL) ruby-mysql by running the command gem install ruby-mysql
Upvotes: 0
Reputation: 663
You need to enter just one command:
rails new railsappname -d mysql
It will create a rails app with mysql configuration.
Upvotes: 0
Reputation: 1719
You actually want to generate the project with the -d specifier, not apply it to your project after generation. Start a new project like this:
rails new myrailsapp -d mysql
Upvotes: 4