I''m trying to generate a controller (but I have this problem with every script): Loading development environment.>> ./script/generate controller CiaoSyntaxError: compile error (irb):1: syntax error, unexpected ''.'' ./script/generate controller Ciao ^ (irb):1: syntax error, unexpected tIDENTIFIER, expecting kDO or ''{'' or ''('' ./script/generate controller Ciao ^ from (irb):1 How can I solve it? thanks --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Snaggy wrote:> I''m trying to generate a controller (but I have this problem with > every script): > > Loading development environment. >>> ./script/generate controller Ciaodon''t do that in a rails console but directly on the shell ruby script/generate controller Ciao the rails console is to directly type ruby code, not to start scripts. -- Posted via http://www.ruby-forum.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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks so much. Since I don''t understand much of ruby and rails, could you point me to some interesting tutorials on how the console works? And can you tell me the difference between ruby and rails? I mean, when i start the console through script/console is that ruby or rails? and how can I call IRB without rails? bye thanks --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Console is an interactive ruby (irb) session in which the rails environment has already been loaded. irb (the normal interactive ruby) is simply started with the irb command.>> ./script/generate controller CiaoConsole and irb are used to allow you to run ruby code interactively (hence the name) so in the console this isn''t a system call to the generate script, it''s just invalid ruby syntax. For the record, you can use `` (backticks) or system() to enclose a shell command that is executed with the STDOUT value given as the return, ie:>> `./script/generate controller Ciao`But you wouldn''t actually do this in practice. You would simply execute ./script/generate controller Ciao in your shell as neongrau_ mentioned. You can learn about ruby and irb in _why''s poignant guide and the ruby pickaxe, both available for free online. You can learn about console in the README in your rails app, in various tutorials on the internet, and in the Agile Web Development With Rails book by the Pragmatic Programmers, which I recommend. Rein http://reinh.com On Sep 4, 6:58 am, Snaggy <l.cio...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Thanks so much. Since I don''t understand much of ruby and rails, could > you point me to some interesting tutorials on how the console works? > > And can you tell me the difference between ruby and rails? I mean, > when i start the console through script/console is that ruby or rails? > and how can I call IRB without rails? > bye > thanks--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---