Hi, I am novice to rails and recently I started learning rails. Still um in the zero point..As I started making a project in rails following the book "Agile Web Developement with rails" I cant con not configure my application to work with mysql. It was a project named depot in the following book. If anyone have this please help me to understand how they connect the mysql database with ruby and execute successfully scaffold command to create a model Product and and a controller Admin. If I also created database, configured the database.yml file followed by the book, and then I went for scaffold command but It cannot create all the files as like as in the book. And If start the script/server I found an error. but there should be a form as it is illustrated in the book. -- Regards, Irfan Ahmed Rizvi http://www.creativemake.com -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 22 August 2010 14:00, Irfan Ahmed <irfandhk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, I am novice to rails and recently I started learning rails. Still um in > the zero point..As I started making a project in rails following the book > "Agile Web Developement with rails" I cant con not configure my application > to work with mysql. It was a project named depot in the following book. If > anyone have this please help me to understand how they connect the mysql > database with ruby and execute successfully scaffold command to create a > model Product and and a controller Admin. > > If I also created database, configured the database.yml file followed by the > book, and then I went for scaffold command but It cannot create all the > files as like as in the book. And If start the script/server I found an > error. but there should be a form as it is illustrated in the book.If you show us your database.yml (not the password obviously) and the command you enter and the errors you are seeing it may be easier for us to help. Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
create.sql (saved in /db) drop table if exists products; create table products ( id int not null auto_increment, title varchar(100) not null, description text not null, image_url varchar(200) not null, price decimal(10, 2) not null, primary key (id) ); Database configuration file: development: adapter: mysql database: depot_development host: localhost username: password: test: adapter: mysql database: depot_test host: localhost username: password: production: adapter: mysql database: depot_production host: localhost username: password: and then if i execute ruby script/server coomand then: it shows: Routing Error No route matches "/admin" with {:method=>:get} -- Irfan Ahmed Rizvi http://www.creativemake.com -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 22 August 2010 14:20, Irfan Ahmed <irfandhk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> create.sql (saved in /db) > drop table if exists products; > create table products ( > id int not null auto_increment, > title varchar(100) not null, > description text not null, > image_url varchar(200) not null, > price decimal(10, 2) not null, > primary key (id) > );I don''t understand what the above is for or what you are doing with it.> > > Database configuration file: > development: > adapter: mysql > database: depot_development > host: localhost > username: > password: > > test: > adapter: mysql > database: depot_test > host: localhost > username: > password: > > production: > adapter: mysql > database: depot_production > host: localhost > username: > password: > > and then if i execute ruby script/server coomand then: > it shows: > > > Routing Error > > No route matches "/admin" with {:method=>:get}Are you saying that it shows that error immediately after starting the server? i think it is more likely that it is when you enter a URL in the browser. Is that correct. If so then it is not a db issue but a routing issue. Have a look at the Rails Guide on routing (http://guides.rubyonrails.org/). First though have a look at the Getting Started guide. Work right through it and make sure you understand all of it. Then work through all the other guides. Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
As you want to see the database.yml and errors which are showing I just mentioned above. I am giving here again the database.yml files details: development: adapter: mysql database: depot_development host: localhost username: password: test: adapter: mysql database: depot_test host: localhost username: password: production: adapter: mysql database: depot_production host: localhost username: password: On 23 August 2010 02:49, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 22 August 2010 14:20, Irfan Ahmed <irfandhk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > create.sql (saved in /db) > > drop table if exists products; > > create table products ( > > id int not null auto_increment, > > title varchar(100) not null, > > description text not null, > > image_url varchar(200) not null, > > price decimal(10, 2) not null, > > primary key (id) > > ); > > I don''t understand what the above is for or what you are doing with it. > > > > > > > Database configuration file: > > development: > > adapter: mysql > > database: depot_development > > host: localhost > > username: > > password: > > > > test: > > adapter: mysql > > database: depot_test > > host: localhost > > username: > > password: > > > > production: > > adapter: mysql > > database: depot_production > > host: localhost > > username: > > password: > > > > and then if i execute ruby script/server coomand then: > > it shows: > > > > > > Routing Error > > > > No route matches "/admin" with {:method=>:get} > > Are you saying that it shows that error immediately after starting the > server? i think it is more likely that it is when you enter a URL in > the browser. Is that correct. If so then it is not a db issue but a > routing issue. Have a look at the Rails Guide on routing > (http://guides.rubyonrails.org/). First though have a look at the > Getting Started guide. Work right through it and make sure you > understand all of it. Then work through all the other guides. > > Colin > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- Irfan Ahmed Rizvi http://www.creativemake.com -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 23 August 2010 06:18, Irfan Ahmed <irfandhk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: Please Irfan do not top post, insert your reply at the appropriate point in the previous message, this will help to follow the thread and also help to make sure you answer all the questions. Thanks In my previous mail I said:>> Are you saying that it shows that error immediately after starting the >> server? i think it is more likely that it is when you enter a URL in >> the browser. Is that correct?You have not answered that question>> If so then it is not a db issue but a >> routing issue. Have a look at the Rails Guide on routing >> (http://guides.rubyonrails.org/). First though have a look at the >> Getting Started guide. Work right through it and make sure you >> understand all of it. Then work through all the other guides.Have you done this?> As you want to see the database.yml and errors which are showing I just > mentioned above. > > > I am giving here again the database.yml files details: > > development: > adapter: mysql > database: depot_development > host: localhost > username: > password: > > test: > adapter: mysql > database: depot_test > host: localhost > username: > password: > > production: > adapter: mysql > database: depot_production > host: localhost > username: > password:That looks OK Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Oh I am sorry for my previous email as I was in a hurry and checking the mail from another place and replying. Now I am trying again! thanks On 23 August 2010 14:02, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 23 August 2010 06:18, Irfan Ahmed <irfandhk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Please Irfan do not top post, insert your reply at the appropriate > point in the previous message, this will help to follow the thread and > also help to make sure you answer all the questions. Thanks > > In my previous mail I said: > > >> Are you saying that it shows that error immediately after starting the > >> server? i think it is more likely that it is when you enter a URL in > >> the browser. Is that correct? > > You have not answered that question > > >> If so then it is not a db issue but a > >> routing issue. Have a look at the Rails Guide on routing > >> (http://guides.rubyonrails.org/). First though have a look at the > >> Getting Started guide. Work right through it and make sure you > >> understand all of it. Then work through all the other guides. > > > Have you done this? > > > As you want to see the database.yml and errors which are showing I just > > mentioned above. > > > > > > I am giving here again the database.yml files details: > > > > development: > > adapter: mysql > > database: depot_development > > host: localhost > > username: > > password: > > > > test: > > adapter: mysql > > database: depot_test > > host: localhost > > username: > > password: > > > > production: > > adapter: mysql > > database: depot_production > > host: localhost > > username: > > password: > > That looks OK > > Colin > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- Irfan Ahmed Rizvi http://www.creativemake.com -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Dear Irfan Ahmed Rizvi! I had many problems with databases in the beginning, especially with mysql. I read the same book. If you go further, there will be extremely good troubleshoots for you to help mysql configuration! I am quite sure, that your answer will be there! My way: 1. create and test your database! if u can add, delete tables and columns manually, from console, than everything works well, you can log in, have the good password, etc. 2. test ur database connection, try it, the same what you made manually, but with rake commands or generated migrations - if u can, or just try again the tutorial what u r reading! 3. if it doesn''t work, try out another database. First it helped me a lot not to change basic database, just let it be sqlite3. Later if u r better, u can play with it easily! 4. maybe some dependent "modul" is missing, which makes Rails connect to databases. if u have Linux check that u installed the full package! Also check that the versions are okay: "rails --version" or "rails - v" , also "gem list". 5. if nothing works, complete reinstall. :) 6. if u bought the book, i''m sure they will help you if u ask them! :) Just don''t give up! I know how hard is it, mostly if u r new to Rails, and u stopped immediately because of database. Just keep going, it will worth, u will see! ;) good luck, for further help, feel free to write me in private! gezope On aug. 22, 15:00, Irfan Ahmed <irfan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, I am novice to rails and recently I started learning rails. Still um in > the zero point..As I started making a project in rails following the book > "Agile Web Developement with rails" I cant con not configure my application > to work with mysql. It was a project named depot in the following book. If > anyone have this please help me to understand how they connect the mysql > database with ruby and execute successfully scaffold command to create a > model Product and and a controller Admin. > > If I also created database, configured the database.yml file followed by the > book, and then I went for scaffold command but It cannot create all the > files as like as in the book. And If start the script/server I found an > error. but there should be a form as it is illustrated in the book. > > -- > Regards, > Irfan Ahmed Rizvihttp://www.creativemake.com-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Dear Gezope Thanks for your inspiration, as I am new in this framework and of-course to new real life programing concept!. Please help me if you feel free and have time! I want to learn! -- Irfan Ahmed Rizvi http://www.creativemake.com -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I have solved all the previous problems today! thanks to all of you:) On 23 August 2010 18:56, Irfan Ahmed <irfandhk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Dear Gezope > Thanks for your inspiration, as I am new in this framework and of-course to > new real life programing concept!. Please help me if you feel free and have > time! I want to learn! > > -- > Irfan Ahmed Rizvi > http://www.creativemake.com > >-- Irfan Ahmed Rizvi http://www.creativemake.com -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.