I''m running script/console but keep getting the message that irb.bat is not recognized as an internal or external command, operable program or batch file. If it means anything I am running instant rails. I can invoke irb straight forward. TIA Stuart -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060609/a49a8f18/attachment.html
On 6/9/06, Dark Ambient <sambient@gmail.com> wrote:> I''m running script/console but keep getting the message that irb.bat is not > recognized as an internal or external command, operable program or batch > file. > > If it means anything I am running instant rails. I can invoke irb straight > forward. > > TIA > Stuart > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >IRB is the Interactive RuBy interpreter. Basically a read-eval loop for Ruby with some niceties. Win32 installations of Ruby tend to have it invoked by the batch C:\ruby\bin\irb.bat. You probably have it, if you can invoke IRB by simply "irb" from the command line. Not sure how instant Rails handles it. You might want to make sure you indeed have it, and also that C:\ruby\bin is in PATH. My guess would be that they are, and instant Rails is looking for irb.bat in some specific place that it''s not. -- -Alder
Thanks for the response, I was able to pull up irb via irb.bat. My problem though is I''m not sure it''s what is needed. I''m working on a tutorial and have these instructions: "At this point, lets test out our user model object. We can do this in the ruby console. Go to your console window run the following: rubyuser@linux:~/workspace/SecuredApp> ruby script/console *Loading development environment.* Now create a new user:>> standon = User.new(:username => "standon")*=> #nil, "username"=>"standon", "password_hash"=>nil}>* Set the password:>> standon.password = "secret"*=> "secret"* Check the password_hash and password_salt properties. Notice how they were set by the password setter method we wrote:>> standon.password_hash*=> "d357cb1a9d6bff0393b4ad8f338e3f29b24a16e3?*>> standon.password_salt*=> "+RH7rfvB" ......................................"* ** *It goes on but I''''m totally confused as to where any of this is to be performed.* Stuart ** On 6/9/06, Alder Green <alder.green@gmail.com> wrote:> > On 6/9/06, Dark Ambient <sambient@gmail.com> wrote: > > I''m running script/console but keep getting the message that irb.bat is > not > > recognized as an internal or external command, operable program or > batch > > file. > > > > If it means anything I am running instant rails. I can invoke irb > straight > > forward. > > > > TIA > > Stuart > > > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > IRB is the Interactive RuBy interpreter. Basically a read-eval loop > for Ruby with some niceties. > > Win32 installations of Ruby tend to have it invoked by the batch > C:\ruby\bin\irb.bat. You probably have it, if you can invoke IRB by > simply "irb" from the command line. Not sure how instant Rails handles > it. You might want to make sure you indeed have it, and also that > C:\ruby\bin is in PATH. My guess would be that they are, and instant > Rails is looking for irb.bat in some specific place that it''s not. > > -- > -Alder > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060609/8855c313/attachment.html
On 6/9/06, Dark Ambient <sambient@gmail.com> wrote:> Thanks for the response, I was able to pull up irb via irb.bat. My problem > though is I''m not sure it''s what is needed. I''m working on a tutorial and > have these instructions: > > "At this point, lets test out our user model object. We can do this in the > ruby console. Go to your console window run the following: > > > rubyuser@linux:~/workspace/SecuredApp> ruby script/console > Loading development environment.SecuredApp is the Rails application directory (codenamed RAILS_ROOT). It''s the directory created when you run rails SecuredApp /script is a standard subdirectory automatically created within any Rails application directory. And /console is one of the (useful) scripts automatically generated for you. Clear now?> > Now create a new user: > > > >> standon = User.new(:username => "standon") > => #nil, "username"=>"standon", "password_hash"=>nil}> > > Set the password: > > > >> standon.password = "secret" > => "secret" > > Check the password_hash and password_salt properties. Notice how they were > set by the password setter method we wrote: > > > >> standon.password_hash > => "d357cb1a9d6bff0393b4ad8f338e3f29b24a16e3? > >> standon.password_salt > => "+RH7rfvB" ......................................" > > > > > It goes on but I''''m totally confused as to where any of this is to be > performed. > > Stuart > > > On 6/9/06, Alder Green <alder.green@gmail.com> wrote: > > On 6/9/06, Dark Ambient <sambient@gmail.com> wrote: > > > I''m running script/console but keep getting the message that irb.bat is > not > > > recognized as an internal or external command, operable program or > batch > > > file. > > > > > > If it means anything I am running instant rails. I can invoke irb > straight > > > forward. > > > > > > TIA > > > Stuart > > > > > > > > > _______________________________________________ > > > Rails mailing list > > > Rails@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > > > > IRB is the Interactive RuBy interpreter. Basically a read-eval loop > > for Ruby with some niceties. > > > > Win32 installations of Ruby tend to have it invoked by the batch > > C:\ruby\bin\irb.bat. You probably have it, if you can invoke IRB by > > simply "irb" from the command line. Not sure how instant Rails handles > > it. You might want to make sure you indeed have it, and also that > > C:\ruby\bin is in PATH. My guess would be that they are, and instant > > Rails is looking for irb.bat in some specific place that it''s not. > > > > -- > > -Alder > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-- -Alder
irb is interactive ruby but it knows nothing about your application, etc. console is a rails application and differs from irb in that it does know something about rails and can use your application/models, etc. from the rails_root directory, like you would invoke server, you would invoke console... ruby script/server ruby script/console Craig On Fri, 2006-06-09 at 10:59 -0600, Dark Ambient wrote:> Thanks for the response, I was able to pull up irb via irb.bat. My > problem though is I''m not sure it''s what is needed. I''m working on a > tutorial and have these instructions: > > "At this point, lets test out our user model object. We can do this in > the ruby console. Go to your console window run the following: > rubyuser@linux:~/workspace/SecuredApp> ruby script/console > Loading development environment. > > > Now create a new user: > > >> standon = User.new(:username => "standon") > => #nil, "username"=>"standon", "password_hash"=>nil}> > > > Set the password: > > >> standon.password = "secret" > => "secret" > > > Check the password_hash and password_salt properties. Notice how they > were set by the password setter method we wrote: > > >> standon.password_hash > => "d357cb1a9d6bff0393b4ad8f338e3f29b24a16e3? > >> standon.password_salt > => "+RH7rfvB" ......................................" > > > It goes on but I''''m totally confused as to where any of this > is to be performed. > > Stuart > > > > > On 6/9/06, Alder Green <alder.green@gmail.com> wrote: > On 6/9/06, Dark Ambient <sambient@gmail.com> wrote: > > I''m running script/console but keep getting the message that > irb.bat is not > > recognized as an internal or external command, operable > program or batch > > file. > > > > If it means anything I am running instant rails. I can > invoke irb straight > > forward. > > > > TIA > > Stuart > > > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > IRB is the Interactive RuBy interpreter. Basically a read-eval > loop > for Ruby with some niceties. > > Win32 installations of Ruby tend to have it invoked by the > batch > C:\ruby\bin\irb.bat. You probably have it, if you can invoke > IRB by > simply "irb" from the command line. Not sure how instant Rails > handles > it. You might want to make sure you indeed have it, and also > that > C:\ruby\bin is in PATH. My guess would be that they are, and > instant > Rails is looking for irb.bat in some specific place that it''s > not. > > -- > -Alder > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails
Clearer :), but still lacking the clarity to complete the task . Do I enter the text as code into the script / console file and then somehow run it ? Stuart On 6/9/06, Alder Green <alder.green@gmail.com> wrote:> > > > Clear now? > > > > > Now create a new user: > > > > > > >> standon = User.new(:username => "standon") > > => #nil, "username"=>"standon", "password_hash"=>nil}> > > > > Set the password: > > > > > > >> standon.password = "secret" > > => "secret" > > > > Check the password_hash and password_salt properties. Notice how they > were > > set by the password setter method we wrote: > > > > > > >> standon.password_hash > > => "d357cb1a9d6bff0393b4ad8f338e3f29b24a16e3? > > >> standon.password_salt > > => "+RH7rfvB" ......................................" > > > > > > > > > > It goes on but I''''m totally confused as to where any of this is to be > > performed. > > > > Stuart > > > > > > On 6/9/06, Alder Green <alder.green@gmail.com> wrote: > > > On 6/9/06, Dark Ambient <sambient@gmail.com> wrote: > > > > I''m running script/console but keep getting the message that irb.batis > > not > > > > recognized as an internal or external command, operable program or > > batch > > > > file. > > > > > > > > If it means anything I am running instant rails. I can invoke irb > > straight > > > > forward. > > > > > > > > TIA > > > > Stuart > > > > > > > > > > > > _______________________________________________ > > > > Rails mailing list > > > > Rails@lists.rubyonrails.org > > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > > > > > > > > > IRB is the Interactive RuBy interpreter. Basically a read-eval loop > > > for Ruby with some niceties. > > > > > > Win32 installations of Ruby tend to have it invoked by the batch > > > C:\ruby\bin\irb.bat. You probably have it, if you can invoke IRB by > > > simply "irb" from the command line. Not sure how instant Rails handles > > > it. You might want to make sure you indeed have it, and also that > > > C:\ruby\bin is in PATH. My guess would be that they are, and instant > > > Rails is looking for irb.bat in some specific place that it''s not. > > > > > > -- > > > -Alder > > > _______________________________________________ > > > Rails mailing list > > > Rails@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > -- > -Alder > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060609/9da17182/attachment.html
On 6/9/06, Dark Ambient <sambient@gmail.com> wrote:> Clearer :), but still lacking the clarity to complete the task . > Do I enter the text as code into the script / console file and then somehow > run it ? > > > Stuart > > On 6/9/06, Alder Green <alder.green@gmail.com> wrote: > > > > > > Clear now? > > > > > > > > Now create a new user: > > > > > > > > > >> standon = User.new(:username => "standon") > > > => #nil, "username"=>"standon", "password_hash"=>nil}> > > > > > > Set the password: > > > > > > > > > >> standon.password = "secret" > > > => "secret" > > > > > > Check the password_hash and password_salt properties. Notice how they > were > > > set by the password setter method we wrote: > > > > > > > > > >> standon.password_hash > > > => "d357cb1a9d6bff0393b4ad8f338e3f29b24a16e3? > > > >> standon.password_salt > > > => "+RH7rfvB" ......................................" > > > > > > > > > > > > > > > It goes on but I''''m totally confused as to where any of this is to be > > > performed. > > > > > > Stuart > > > > > > > > > On 6/9/06, Alder Green < alder.green@gmail.com> wrote: > > > > On 6/9/06, Dark Ambient <sambient@gmail.com> wrote: > > > > > I''m running script/console but keep getting the message that irb.bat > is > > > not > > > > > recognized as an internal or external command, operable program or > > > batch > > > > > file. > > > > > > > > > > If it means anything I am running instant rails. I can invoke irb > > > straight > > > > > forward. > > > > > > > > > > TIA > > > > > Stuart > > > > > > > > > > > > > > > _______________________________________________ > > > > > Rails mailing list > > > > > Rails@lists.rubyonrails.org > > > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > > > > > > > > > > > > > > IRB is the Interactive RuBy interpreter. Basically a read-eval loop > > > > for Ruby with some niceties. > > > > > > > > Win32 installations of Ruby tend to have it invoked by the batch > > > > C:\ruby\bin\irb.bat. You probably have it, if you can invoke IRB by > > > > simply "irb" from the command line. Not sure how instant Rails handles > > > > it. You might want to make sure you indeed have it, and also that > > > > C:\ruby\bin is in PATH. My guess would be that they are, and instant > > > > Rails is looking for irb.bat in some specific place that it''s not. > > > > > > > > -- > > > > -Alder > > > > _______________________________________________ > > > > Rails mailing list > > > > Rails@lists.rubyonrails.org > > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > > > > _______________________________________________ > > > Rails mailing list > > > Rails@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > > > > > > -- > > -Alder > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >Yes. script/console is very much like IRB. You type ruby expressions after the prompt, and run (well more accurately "evaluate") them by pressing Enter. -- -Alder
Dark Ambient wrote:> Clearer :), but still lacking the clarity to complete the task . > Do I enter the text as code into the script / console file and then > somehow > run it ? > > StuartNo. When you run script/console, Rails loads your development code (ie, the models that you''ve specified in the app/models folder), and you are presented with an interactive prompt. At that point you can execute whatever Ruby code you want to inspect or change your models. So following the above tutorial, you would type the following at the prompt: standon = User.new(:username => "standon") which would create a new User object with the username set to "standon" It saves you from having to write this code in your controller and then output it in your view. -- Posted via http://www.ruby-forum.com/.
It must be missing then from my configuration. I either get nothing or a load error. Stuart On 6/9/06, Alder Green <alder.green@gmail.com> wrote:> > On 6/9/06, Dark Ambient <sambient@gmail.com> wrote: > > Clearer :), but still lacking the clarity to complete the task . > > Do I enter the text as code into the script / console file and then > somehow > > run it ? > > > > > > Stuart > > > > On 6/9/06, Alder Green <alder.green@gmail.com> wrote: > > > > > > > > > Clear now? > > > > > > > > > > > Now create a new user: > > > > > > > > > > > > >> standon = User.new(:username => "standon") > > > > => #nil, "username"=>"standon", "password_hash"=>nil}> > > > > > > > > Set the password: > > > > > > > > > > > > >> standon.password = "secret" > > > > => "secret" > > > > > > > > Check the password_hash and password_salt properties. Notice how > they > > were > > > > set by the password setter method we wrote: > > > > > > > > > > > > >> standon.password_hash > > > > => "d357cb1a9d6bff0393b4ad8f338e3f29b24a16e3? > > > > >> standon.password_salt > > > > => "+RH7rfvB" ......................................" > > > > > > > > > > > > > > > > > > > > It goes on but I''''m totally confused as to where any of this is to > be > > > > performed. > > > > > > > > Stuart > > > > > > > > > > > > On 6/9/06, Alder Green < alder.green@gmail.com> wrote: > > > > > On 6/9/06, Dark Ambient <sambient@gmail.com> wrote: > > > > > > I''m running script/console but keep getting the message that > irb.bat > > is > > > > not > > > > > > recognized as an internal or external command, operable program > or > > > > batch > > > > > > file. > > > > > > > > > > > > If it means anything I am running instant rails. I can invoke > irb > > > > straight > > > > > > forward. > > > > > > > > > > > > TIA > > > > > > Stuart > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > Rails mailing list > > > > > > Rails@lists.rubyonrails.org > > > > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > > > > > > > > > > > > > > > > > > > IRB is the Interactive RuBy interpreter. Basically a read-eval > loop > > > > > for Ruby with some niceties. > > > > > > > > > > Win32 installations of Ruby tend to have it invoked by the batch > > > > > C:\ruby\bin\irb.bat. You probably have it, if you can invoke IRB > by > > > > > simply "irb" from the command line. Not sure how instant Rails > handles > > > > > it. You might want to make sure you indeed have it, and also that > > > > > C:\ruby\bin is in PATH. My guess would be that they are, and > instant > > > > > Rails is looking for irb.bat in some specific place that it''s not. > > > > > > > > > > -- > > > > > -Alder > > > > > _______________________________________________ > > > > > Rails mailing list > > > > > Rails@lists.rubyonrails.org > > > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > > > > > > > > _______________________________________________ > > > > Rails mailing list > > > > Rails@lists.rubyonrails.org > > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > > > > > > > > > > > > -- > > > -Alder > > > _______________________________________________ > > > Rails mailing list > > > Rails@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > Yes. script/console is very much like IRB. You type ruby expressions > after the prompt, and run (well more accurately "evaluate") them by > pressing Enter. > > -- > -Alder > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060609/8d8e2ade/attachment.html
Here is what I get just typing ruby script/console: C:\InstantRails\ruby\bin>ruby script/console ruby: No such file or directory -- script/console (LoadError) I might have some environment issues , but I ran this from the ruby / bin directory. Stuart On 6/9/06, Dark Ambient <sambient@gmail.com> wrote:> > It must be missing then from my configuration. I either get nothing or a > load error. > > > Stuart > > On 6/9/06, Alder Green < alder.green@gmail.com> wrote: > > > > On 6/9/06, Dark Ambient < sambient@gmail.com> wrote: > > > Clearer :), but still lacking the clarity to complete the task . > > > Do I enter the text as code into the script / console file and then > > somehow > > > run it ? > > > > > > > > > Stuart > > > > > > On 6/9/06, Alder Green <alder.green@gmail.com> wrote: > > > > > > > > > > > > Clear now? > > > > > > > > > > > > > > Now create a new user: > > > > > > > > > > > > > > > >> standon = User.new(:username => "standon") > > > > > => #nil, "username"=>"standon", "password_hash"=>nil}> > > > > > > > > > > Set the password: > > > > > > > > > > > > > > > >> standon.password = "secret" > > > > > => "secret" > > > > > > > > > > Check the password_hash and password_salt properties. Notice how > > they > > > were > > > > > set by the password setter method we wrote: > > > > > > > > > > > > > > > >> standon.password_hash > > > > > => "d357cb1a9d6bff0393b4ad8f338e3f29b24a16e3? > > > > > >> standon.password_salt > > > > > => "+RH7rfvB" ......................................" > > > > > > > > > > > > > > > > > > > > > > > > > It goes on but I''''m totally confused as to where any of this is to > > be > > > > > performed. > > > > > > > > > > Stuart > > > > > > > > > > > > > > > On 6/9/06, Alder Green < alder.green@gmail.com> wrote: > > > > > > On 6/9/06, Dark Ambient < sambient@gmail.com> wrote: > > > > > > > I''m running script/console but keep getting the message that > > irb.bat > > > is > > > > > not > > > > > > > recognized as an internal or external command, operable > > program or > > > > > batch > > > > > > > file. > > > > > > > > > > > > > > If it means anything I am running instant rails. I can invoke > > irb > > > > > straight > > > > > > > forward. > > > > > > > > > > > > > > TIA > > > > > > > Stuart > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > Rails mailing list > > > > > > > Rails@lists.rubyonrails.org > > > > > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > IRB is the Interactive RuBy interpreter. Basically a read-eval > > loop > > > > > > for Ruby with some niceties. > > > > > > > > > > > > Win32 installations of Ruby tend to have it invoked by the batch > > > > > > C:\ruby\bin\irb.bat. You probably have it, if you can invoke IRB > > by > > > > > > simply "irb" from the command line. Not sure how instant Rails > > handles > > > > > > it. You might want to make sure you indeed have it, and also > > that > > > > > > C:\ruby\bin is in PATH. My guess would be that they are, and > > instant > > > > > > Rails is looking for irb.bat in some specific place that it''s > > not. > > > > > > > > > > > > -- > > > > > > -Alder > > > > > > _______________________________________________ > > > > > > Rails mailing list > > > > > > Rails@lists.rubyonrails.org > > > > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > Rails mailing list > > > > > Rails@lists.rubyonrails.org > > > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > -Alder > > > > _______________________________________________ > > > > Rails mailing list > > > > Rails@lists.rubyonrails.org > > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > > > > _______________________________________________ > > > Rails mailing list > > > Rails@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > > > > Yes. script/console is very much like IRB. You type ruby expressions > > after the prompt, and run (well more accurately "evaluate") them by > > pressing Enter. > > > > -- > > -Alder > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060609/36dc84dc/attachment-0001.html
On 6/9/06, Dark Ambient <sambient@gmail.com> wrote:> It must be missing then from my configuration. I either get nothing or a > load error.I''m not positive, but I believe with Instant Rails you need to launch the console window from within the Instant Rails control panel thingie... I would check the documentation on it to be sure. -Curtis
On 6/9/06, Dark Ambient <sambient@gmail.com> wrote:> Here is what I get just typing ruby script/console: > > C:\InstantRails\ruby\bin>ruby script/console > ruby: No such file or directory -- script/console (LoadError) > > I might have some environment issues , but I ran this from the ruby / bin > directory. > > Stuart > > > On 6/9/06, Dark Ambient <sambient@gmail.com> wrote: > > > > It must be missing then from my configuration. I either get nothing or a > load error. > > > > > > Stuart > > > > > > On 6/9/06, Alder Green < alder.green@gmail.com> wrote: > > > On 6/9/06, Dark Ambient < sambient@gmail.com> wrote: > > > > Clearer :), but still lacking the clarity to complete the task . > > > > Do I enter the text as code into the script / console file and then > somehow > > > > run it ? > > > > > > > > > > > > Stuart > > > > > > > > On 6/9/06, Alder Green <alder.green@gmail.com> wrote: > > > > > > > > > > > > > > > Clear now? > > > > > > > > > > > > > > > > > Now create a new user: > > > > > > > > > > > > > > > > > > >> standon = User.new(:username => "standon") > > > > > > => #nil, "username"=>"standon", "password_hash"=>nil}> > > > > > > > > > > > > Set the password: > > > > > > > > > > > > > > > > > > >> standon.password = "secret" > > > > > > => "secret" > > > > > > > > > > > > Check the password_hash and password_salt properties. Notice how > they > > > > were > > > > > > set by the password setter method we wrote: > > > > > > > > > > > > > > > > > > >> standon.password_hash > > > > > > => "d357cb1a9d6bff0393b4ad8f338e3f29b24a16e3? > > > > > > >> standon.password_salt > > > > > > => "+RH7rfvB" > ......................................" > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > It goes on but I''''m totally confused as to where any of this is to > be > > > > > > performed. > > > > > > > > > > > > Stuart > > > > > > > > > > > > > > > > > > On 6/9/06, Alder Green < alder.green@gmail.com> wrote: > > > > > > > On 6/9/06, Dark Ambient < sambient@gmail.com> wrote: > > > > > > > > I''m running script/console but keep getting the message that > irb.bat > > > > is > > > > > > not > > > > > > > > recognized as an internal or external command, operable > program or > > > > > > batch > > > > > > > > file. > > > > > > > > > > > > > > > > If it means anything I am running instant rails. I can invoke > irb > > > > > > straight > > > > > > > > forward. > > > > > > > > > > > > > > > > TIA > > > > > > > > Stuart > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > Rails mailing list > > > > > > > > Rails@lists.rubyonrails.org > > > > > > > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > IRB is the Interactive RuBy interpreter. Basically a read-eval > loop > > > > > > > for Ruby with some niceties. > > > > > > > > > > > > > > Win32 installations of Ruby tend to have it invoked by the batch > > > > > > > C:\ruby\bin\irb.bat. You probably have it, if you can invoke IRB > by > > > > > > > simply "irb" from the command line. Not sure how instant Rails > handles > > > > > > > it. You might want to make sure you indeed have it, and also > that > > > > > > > C:\ruby\bin is in PATH. My guess would be that they are, and > instant > > > > > > > Rails is looking for irb.bat in some specific place that it''s > not. > > > > > > > > > > > > > > -- > > > > > > > -Alder > > > > > > > _______________________________________________ > > > > > > > Rails mailing list > > > > > > > Rails@lists.rubyonrails.org > > > > > > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > Rails mailing list > > > > > > Rails@lists.rubyonrails.org > > > > > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > -Alder > > > > > _______________________________________________ > > > > > Rails mailing list > > > > > Rails@lists.rubyonrails.org > > > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > > > > > > > > _______________________________________________ > > > > Rails mailing list > > > > Rails@lists.rubyonrails.org > > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > > > > > > > > > Yes. script/console is very much like IRB. You type ruby expressions > > > after the prompt, and run (well more accurately "evaluate") them by > > > pressing Enter. > > > > > > -- > > > -Alder > > > _______________________________________________ > > > Rails mailing list > > > Rails@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >/ is not standard Win32 notation. Try ruby script\console -- -Alder
Dark Ambient wrote:> Here is what I get just typing ruby script/console: > > C:\InstantRails\ruby\bin>ruby script/console > ruby: No such file or directory -- script/console (LoadError) > > I might have some environment issues , but I ran this from the ruby / > bin directory. > > StuartTo the best of my knowledge, you should run that command in the APP directory. Since you are using InstantRails, it should be something like (for the application "cookbook") c:\InstantRails\rails_apps\cookbook>ruby script/console or c:\InstantRails\rails_apps\cookbook>ruby script\console Hope this helps. Mohit.
On 6/9/06, Dark Ambient <sambient@gmail.com> wrote:> I might have some environment issues , but I ran this from the ruby / bin > directory.It needs to be run from your root application directory. For instance, I use mine in documents and settings; with each application under a "rails" directory. So I would traverse to: c:\documents and settings\curtis\rails\arailsapp\>ruby script/console And I would get a console linking into the code for the arailsapp application. I still think Instant Rails may do it a little differently though. I recall a few things along those lines that led me away from it to just install everything from scratch... -Curtis
Just as I was about to add ruby/bin to the environment variables your email came through. Yes, I opened the console window from Instantrails and while it looked like a regular cmd window , the command script/console worked. My apologies, I''ve been doing most of the work in radrails and completely forgot about the console option. Thanks to all for the help and my apologies for being totally stupid about this. Stuart On 6/9/06, Curtis <cuspendlove@gmail.com> wrote:> > On 6/9/06, Dark Ambient <sambient@gmail.com> wrote: > > It must be missing then from my configuration. I either get nothing or > a > > load error. > > I''m not positive, but I believe with Instant Rails you need to launch > the console window from within the Instant Rails control panel > thingie... I would check the documentation on it to be sure. > > -Curtis > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060609/f4be9610/attachment.html
On 6/9/06, Dark Ambient <sambient@gmail.com> wrote:> Just as I was about to add ruby/bin to the environment variables your email > came through. Yes, I opened the console window from Instantrails and while > it looked like a regular cmd window , the command script/console worked. > My apologies, I''ve been doing most of the work in radrails and completely > forgot about the console option. > Thanks to all for the help and my apologies for being totally stupid about > this.Heehee... None of us (except maybe the core team) knew all of this stuff when they were born.... No worries. :) -Curtis
Seems like one spends more time trying to figure out how to get the system working and then debugging bad code. If it''s okay though I''ll use this thread since now that I have the console running it''s spitting out an error that I''m not clear on. First the error:>> standon = User.new(:user_name => "standon")NameError: uninitialized constant User from C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:100:in ` const_missing'' from C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:131:in ` const_missing'' from (irb):3>>Yet here in the model it looks like user is defined: def self.login(username, password) user = User.find(:first, :conditions => [''user_name = ?'' , user_name]) if user expected_password = encrypted_password(password, user.password_salt) if user.password_hash != expected_password user = nil end end user #this makes no sense to but end Stuart On 6/9/06, Curtis <cuspendlove@gmail.com> wrote:> > On 6/9/06, Dark Ambient <sambient@gmail.com> wrote: > > Just as I was about to add ruby/bin to the environment variables your > email > > came through. Yes, I opened the console window from Instantrails and > while > > it looked like a regular cmd window , the command script/console worked. > > My apologies, I''ve been doing most of the work in radrails and > completely > > forgot about the console option. > > Thanks to all for the help and my apologies for being totally stupid > about > > this. > > Heehee... None of us (except maybe the core team) knew all of this > stuff when they were born.... No worries. :) > > > -Curtis > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060609/6ae88294/attachment.html
On 6/9/06, Dark Ambient <sambient@gmail.com> wrote:> Seems like one spends more time trying to figure out how to get the system > working and then debugging bad code. > > If it''s okay though I''ll use this thread since now that I have the console > running it''s spitting out an error that I''m not clear on. > > First the error: > >> standon = User.new(:user_name => "standon") > NameError: uninitialized constant User > from > C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:100:in > ` > const_missing'' > from > C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:131:in > ` > const_missing'' > from (irb):3 > >> > > Yet here in the model it looks like user is defined: > def self.login(username, password) > > user = User.find(:first, :conditions => [''user_name = ?'' , > user_name]) > if user > > expected_password = encrypted_password(password, > user.password_salt) > if user.password_hash != expected_password > > user = nil > > end > > end > user #this makes no sense to but > > end > > Stuart >Stuart: I would recommend gaining a good understanding of the basic concepts of Ruby and Rails first. Asking about every error you get here would likely not be productive for you or the medium. AWDWR and Ruby for Rails would be good introductory texts.> > On 6/9/06, Curtis <cuspendlove@gmail.com > wrote: > > On 6/9/06, Dark Ambient <sambient@gmail.com > wrote: > > > Just as I was about to add ruby/bin to the environment variables your > email > > > came through. Yes, I opened the console window from Instantrails and > while > > > it looked like a regular cmd window , the command script/console worked. > > > My apologies, I''ve been doing most of the work in radrails and > completely > > > forgot about the console option. > > > Thanks to all for the help and my apologies for being totally stupid > about > > > this. > > > > Heehee... None of us (except maybe the core team) knew all of this > > stuff when they were born.... No worries. :) > > > > > > -Curtis > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-- -Alder
My apologies Alder, thank you ! Stuart On 6/9/06, Alder Green <alder.green@gmail.com> wrote:> > On 6/9/06, Dark Ambient <sambient@gmail.com> wrote: > > Seems like one spends more time trying to figure out how to get the > system > > working and then debugging bad code. > > > > If it''s okay though I''ll use this thread since now that I have the > console > > running it''s spitting out an error that I''m not clear on. > > > > First the error: > > >> standon = User.new(:user_name => "standon") > > NameError: uninitialized constant User > > from > > C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1 > /lib/active_support/dependencies.rb:100:in > > ` > > const_missing'' > > from > > C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1 > /lib/active_support/dependencies.rb:131:in > > ` > > const_missing'' > > from (irb):3 > > >> > > > > Yet here in the model it looks like user is defined: > > def self.login(username, password) > > > > user = User.find(:first, :conditions => [''user_name = ?'' , > > user_name]) > > if user > > > > expected_password = encrypted_password(password, > > user.password_salt) > > if user.password_hash != expected_password > > > > user = nil > > > > end > > > > end > > user #this makes no sense to but > > > > end > > > > Stuart > > > > Stuart: > > I would recommend gaining a good understanding of the basic concepts > of Ruby and Rails first. > > Asking about every error you get here would likely not be productive > for you or the medium. > > AWDWR and Ruby for Rails would be good introductory texts. > > > > > On 6/9/06, Curtis <cuspendlove@gmail.com > wrote: > > > On 6/9/06, Dark Ambient <sambient@gmail.com > wrote: > > > > Just as I was about to add ruby/bin to the environment variables > your > > email > > > > came through. Yes, I opened the console window from Instantrails > and > > while > > > > it looked like a regular cmd window , the command script/console > worked. > > > > My apologies, I''ve been doing most of the work in radrails and > > completely > > > > forgot about the console option. > > > > Thanks to all for the help and my apologies for being totally stupid > > about > > > > this. > > > > > > Heehee... None of us (except maybe the core team) knew all of this > > > stuff when they were born.... No worries. :) > > > > > > > > > -Curtis > > > _______________________________________________ > > > Rails mailing list > > > Rails@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > -- > -Alder > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060609/cbf546d4/attachment-0001.html