I''m new to Ruby. I installed Rails on Windows 8. When I type mkdir in IRB, I''m getting this. I tried running the IRB as administrator too, and still get the same result irb(main):001:0> mkdir lesson2 NameError: undefined local variable or method `lesson2'' for main:Object from (irb):1 from C:/RailsInstaller/Ruby1.9.3/bin/irb:12:in `<main>'' irb(main):002:0> cd lesson -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/eeef5f0a-4225-4f9b-9ac0-30aafb351ff0%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Im new to Ruby and isntalled Rails on Windows 8. I tried typing this in IRB run it normal or as administrator and getting this result. might have duplicated this post, first time posting on the group did not see where my post is :) irb(main):001:0> mkdir lesson2 NameError: undefined local variable or method `lesson2'' for main:Object from (irb):1 from C:/RailsInstaller/Ruby1.9.3/bin/irb:12:in `<main>'' irb(main):002:0> cd lesson -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/784ed9b2-58d9-4a1a-8b1b-bf77db4c6abd%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
On 21 June 2013 14:12, Oliver David <odavid3-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''m new to Ruby. I installed Rails on Windows 8. > > When I type mkdir in IRB, I''m getting this. I tried running the IRB as > administrator too, and still get the same result > > > irb(main):001:0> mkdir lesson2 > NameError: undefined local variable or method `lesson2'' for main:Object > from (irb):1 > from C:/RailsInstaller/Ruby1.9.3/bin/irb:12:in `<main>'' > irb(main):002:0> cd lessonThose commands (mkdir and cd) are not supposed to be run in irb (which is for ruby code), but in a console window. Whether they work in Windows anyway I do not know. I strongly advise not to use Windows for developing RoR applications, it is much easier in Linux (Ubuntu for example) or Mac. Colin> > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit > https://groups.google.com/d/msgid/rubyonrails-talk/eeef5f0a-4225-4f9b-9ac0-30aafb351ff0%40googlegroups.com. > > For more options, visit https://groups.google.com/groups/opt_out. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLsJRDW-wc8wMLLitR5DXo4vFKYhgigaRnRnccfQLv-FcQ%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
Hi there, The problem is that you''re trying to run a command that''s not a part of Ruby, but just part of the basic command tools Windows provides. When you type "mkdir lesson2", you''re giving the command to create a folder named "lesson2", however, like I said, this is not part of Ruby and IRB. Solution is to exit IRB (CTRL+D?) and then putting the command "mkdir lesson2", after which you can open IRB again to try some Ruby code. I hope this helps! If you have any other questions, feel free to let me know :-) -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/cde6563cbcec5ea0671e4cdd472a2a38%40ruby-forum.com. For more options, visit https://groups.google.com/groups/opt_out.
You can also execute system commands from within irb using "system" system( "mkdir lesson2" ) or backticks `mkdir lesson2` Although in the case of "mkdir" you''ll probably want to use "Dir.pwd" to check you''re in the right directory, and "Dir.chdir(''c:/myfolder'')" to move to the correct folder first. -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/4432e7cfb49874eb344e74708f68dfca%40ruby-forum.com. For more options, visit https://groups.google.com/groups/opt_out.
I used the cmd prompt Windows and type IRB to start and get that error. On Friday, June 21, 2013 10:49:39 AM UTC-4, Colin Law wrote:> > On 21 June 2013 14:12, Oliver David <oda...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <javascript:>> > wrote: > > I''m new to Ruby. I installed Rails on Windows 8. > > > > When I type mkdir in IRB, I''m getting this. I tried running the IRB as > > administrator too, and still get the same result > > > > > > irb(main):001:0> mkdir lesson2 > > NameError: undefined local variable or method `lesson2'' for main:Object > > from (irb):1 > > from C:/RailsInstaller/Ruby1.9.3/bin/irb:12:in `<main>'' > > irb(main):002:0> cd lesson > > Those commands (mkdir and cd) are not supposed to be run in irb (which > is for ruby code), but in a console window. Whether they work in > Windows anyway I do not know. I strongly advise not to use Windows > for developing RoR applications, it is much easier in Linux (Ubuntu > for example) or Mac. > > Colin > > > > > -- > > You received this message because you are subscribed to the Google > Groups > > "Ruby on Rails: Talk" group. > > To unsubscribe from this group and stop receiving emails from it, send > an > > email to rubyonrails-ta...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>. > > To post to this group, send email to rubyonra...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<javascript:>. > > > To view this discussion on the web visit > > > https://groups.google.com/d/msgid/rubyonrails-talk/eeef5f0a-4225-4f9b-9ac0-30aafb351ff0%40googlegroups.com. > > > > > For more options, visit https://groups.google.com/groups/opt_out. > > > > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/e0a72d8d-ba65-4aa1-961b-9ec69a79e6c5%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
IRB is not the command line. Use the command line to mkdir. On Fri, Jun 21, 2013 at 10:56 PM, Oliver David <odavid3-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I used the cmd prompt Windows and type IRB to start and get that error. > > On Friday, June 21, 2013 10:49:39 AM UTC-4, Colin Law wrote: > >> On 21 June 2013 14:12, Oliver David <oda...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> > I''m new to Ruby. I installed Rails on Windows 8. >> > >> > When I type mkdir in IRB, I''m getting this. I tried running the IRB as >> > administrator too, and still get the same result >> > >> > >> > irb(main):001:0> mkdir lesson2 >> > NameError: undefined local variable or method `lesson2'' for main:Object >> > from (irb):1 >> > from C:/RailsInstaller/Ruby1.9.3/**bin/irb:12:in `<main>'' >> > irb(main):002:0> cd lesson >> >> Those commands (mkdir and cd) are not supposed to be run in irb (which >> is for ruby code), but in a console window. Whether they work in >> Windows anyway I do not know. I strongly advise not to use Windows >> for developing RoR applications, it is much easier in Linux (Ubuntu >> for example) or Mac. >> >> Colin >> >> > >> > -- >> > You received this message because you are subscribed to the Google >> Groups >> > "Ruby on Rails: Talk" group. >> > To unsubscribe from this group and stop receiving emails from it, send >> an >> > email to rubyonrails-ta...@**googlegroups.com. >> > To post to this group, send email to rubyonra...@googlegroups.**com. >> > To view this discussion on the web visit >> > https://groups.google.com/d/**msgid/rubyonrails-talk/** >> eeef5f0a-4225-4f9b-9ac0-**30aafb351ff0%40googlegroups.**com<https://groups.google.com/d/msgid/rubyonrails-talk/eeef5f0a-4225-4f9b-9ac0-30aafb351ff0%40googlegroups.com>. >> >> > >> > For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>. >> >> > >> > >> > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit > https://groups.google.com/d/msgid/rubyonrails-talk/e0a72d8d-ba65-4aa1-961b-9ec69a79e6c5%40googlegroups.com > . > For more options, visit https://groups.google.com/groups/opt_out. > > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CA%2BqZRNkoqkKCoGx%3DCBnabFkm-n_sT2NoSwDAqRxM_-fxR%3D78VQ%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
I got it working. Thanks for helping. On Friday, June 21, 2013 11:22:05 PM UTC-4, kotp wrote:> > IRB is not the command line. Use the command line to mkdir. > > > On Fri, Jun 21, 2013 at 10:56 PM, Oliver David <oda...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org<javascript:> > > wrote: > >> I used the cmd prompt Windows and type IRB to start and get that error. >> >> On Friday, June 21, 2013 10:49:39 AM UTC-4, Colin Law wrote: >> >>> On 21 June 2013 14:12, Oliver David <oda...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>> > I''m new to Ruby. I installed Rails on Windows 8. >>> > >>> > When I type mkdir in IRB, I''m getting this. I tried running the IRB >>> as >>> > administrator too, and still get the same result >>> > >>> > >>> > irb(main):001:0> mkdir lesson2 >>> > NameError: undefined local variable or method `lesson2'' for >>> main:Object >>> > from (irb):1 >>> > from C:/RailsInstaller/Ruby1.9.3/**bin/irb:12:in `<main>'' >>> > irb(main):002:0> cd lesson >>> >>> Those commands (mkdir and cd) are not supposed to be run in irb (which >>> is for ruby code), but in a console window. Whether they work in >>> Windows anyway I do not know. I strongly advise not to use Windows >>> for developing RoR applications, it is much easier in Linux (Ubuntu >>> for example) or Mac. >>> >>> Colin >>> >>> > >>> > -- >>> > You received this message because you are subscribed to the Google >>> Groups >>> > "Ruby on Rails: Talk" group. >>> > To unsubscribe from this group and stop receiving emails from it, send >>> an >>> > email to rubyonrails-ta...@**googlegroups.com. >>> > To post to this group, send email to rubyonra...@googlegroups.**com. >>> > To view this discussion on the web visit >>> > https://groups.google.com/d/**msgid/rubyonrails-talk/** >>> eeef5f0a-4225-4f9b-9ac0-**30aafb351ff0%40googlegroups.**com<https://groups.google.com/d/msgid/rubyonrails-talk/eeef5f0a-4225-4f9b-9ac0-30aafb351ff0%40googlegroups.com>. >>> >>> > >>> > For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>. >>> >>> > >>> > >>> >> -- >> You received this message because you are subscribed to the Google Groups >> "Ruby on Rails: Talk" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to rubyonrails-ta...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>. >> To post to this group, send email to rubyonra...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<javascript:> >> . >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/rubyonrails-talk/e0a72d8d-ba65-4aa1-961b-9ec69a79e6c5%40googlegroups.com >> . >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/a7b5d1a2-da4e-4e23-abee-e82bb3eca96e%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.