Topic: Using MySQL with ruby on rail

Let me just ask a question. 

Rails is the server just like Apache, and Rails is the scripting language just like PHP?

Well i want to install mysql so i can use this with ruby and rails.  I have installed ruby and rails using the installer from the ruby website.

I already have mysql installed under apache can i use it?

one more thing if you can help me. The book im reading says i have to create a new application by typing the command "rails appname" through the console / a new command line? Im really confused there is no other command line and the cmd does not recognize this command?

Last edited by tbobker (2007-04-13 15:37:53)

Re: Using MySQL with ruby on rail

Rails is the server just like Apache, and Rails is the scripting language just like PHP?

Rails is not actually a server.  You would need something like mongrel as the server.  Ruby does come with webbrick, but it's not meant to be used in production.

I already have mysql installed under apache can i use it?

Normally apache talks to a rails server like mongrel, and rails talks to mysql.  Are you trying to setup a development environment?  If so, then you shouldn't need apache, you can use the server that comes with rails.  Run the command 'ruby script/server' from your project directory.

one more thing if you can help me. The book im reading says i have to create a new application by typing the command "rails appname" through the console / a new command line? Im really confused there is no other command line and the cmd does not recognize this command?

What are the steps you took to install rails?  What happens when you run ruby -v?

Re: Using MySQL with ruby on rail

Hi thanks for your reply.

Iam reading agile web development with rails. I downloaded the windows installer and ran it on my windows desktop. It installed ruby and rails because i have a new menu item in the start menu.

Next in my book it tells me that its easier to use mysql. So i thought that i already have php installed running on apache with mysql, maybe i can use that?

It kind of skips stuff and just tells me to open a shell window? im on windows not Linux? Then it says to create your first application rails will install all the directories for me when i run this command:

cd work //change directory
work> rails demo //demo being the name of my project

and then it should work? but it doesnt in the cmd i get command not found?

Re: Using MySQL with ruby on rail

Also install Rails
gem install rails --include-dependencies

Re: Using MySQL with ruby on rail

I think dvohra may be right.  The Ruby installer does not come with rails.  You have to install that separately.

Re: Using MySQL with ruby on rail

tbobker wrote:

Hi thanks for your reply.

Iam reading agile web development with rails. I downloaded the windows installer and ran it on my windows desktop. It installed ruby and rails because i have a new menu item in the start menu.

Next in my book it tells me that its easier to use mysql. So i thought that i already have php installed running on apache with mysql, maybe i can use that?

It kind of skips stuff and just tells me to open a shell window? im on windows not Linux? Then it says to create your first application rails will install all the directories for me when i run this command:

cd work //change directory
work> rails demo //demo being the name of my project

and then it should work? but it doesnt in the cmd i get command not found?

I'm using the same book!

I downloaded instant rails and it set everything up for me.

One thing I noted is you have to be in the right directory, so cd work\demo

then try: ruby script/server

that will start your server, then I usually have to open another command prompt window since this one seems to be waiting for the ctrl C to stop Mongrel.

In the new window cd again to work\demo and then try to create your new application.

Post the page number your are on I will look into it for you, and maybe we can work through the book together!

Don.