Forum: Ruby on Rails Rad Rails and rails console

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Richard D. (Guest)
on 2006-02-17 04:39
Hello,

In learning Ruby on rails I became hooked on using the Console (ruby
script/console) to interact with models.  I have been playing with
RadRails over the past week and haven't figured out how to get a console
going (or if this feature is even available).  Though documentation is
minimal, RadRails is fairly intuitive and overall a nice way to write
apps.  I just can't figure out how to access the console.

Any suggestions?  Thanks in advance!
Rath (Guest)
on 2006-02-17 05:54
From the command prompt go to the root directory were you have created
the project. (the place from where you can see the app directory)

Type: ruby script/console

You can start using it.

If you want to reset the console because you have modified any of the
models then

Dispatcher.reset_application! will reset the console without having to
exit

richard downe wrote:
> Hello,
>
> In learning Ruby on rails I became hooked on using the Console (ruby
> script/console) to interact with models.  I have been playing with
> RadRails over the past week and haven't figured out how to get a console
> going (or if this feature is even available).  Though documentation is
> minimal, RadRails is fairly intuitive and overall a nice way to write
> apps.  I just can't figure out how to access the console.
>
> Any suggestions?  Thanks in advance!
Rath (Guest)
on 2006-02-17 06:18
You can also run external tools within Eclipse.

Click Run -> External Tools -> External Tools

Create a New tool

Location: c:\ruby\bin\ruby.exe
Working directory: ${project_loc}
Arguments: script\console

Hope this helps
Rath (Guest)
on 2006-02-17 06:18
Rath wrote:
> You can also run external tools within Eclipse.
>
> Click Run -> External Tools -> External Tools
>
> Create a New tool
>
> Location: c:\ruby\bin\ruby.exe
> Working directory: ${project_loc}
> Arguments: script\console
>
> Hope this helps

Don't forget to Name the tool and apply changes.
Richard D. (Guest)
on 2006-02-17 07:45
Rath wrote:
> Rath wrote:
>> You can also run external tools within Eclipse.
>>
>> Click Run -> External Tools -> External Tools
>>
>> Create a New tool
>>
>> Location: c:\ruby\bin\ruby.exe
>> Working directory: ${project_loc}
>> Arguments: script\console
>>
>> Hope this helps
>
> Don't forget to Name the tool and apply changes.

Thanks Rath.  I'm familiar with running the console from a windows
command prompt (for example) but I'm trying to access the same feature
in Rad Rails.  I took your suggestion about Eclipse and within RadRails,
it seems as if you need to go to the Ruby 'perspective' to see 'Run'.
But, under 'Run' ther is no option for External tools.  I've tried
entering 'script/console' as an argument but I keep getting an error
message - 'unable to load module'.  The strange thing is if I run
script/generate, I get the help screen for 'generators', so at least
script does work.  It's just the console side of things that isn't
working.
Thanks again.
Richard D. (Guest)
on 2006-02-17 08:05
richard downe wrote:
> Rath wrote:
>> Rath wrote:
>>> You can also run external tools within Eclipse.
>>>
>>> Click Run -> External Tools -> External Tools
>>>
>>> Create a New tool
>>>
>>> Location: c:\ruby\bin\ruby.exe
>>> Working directory: ${project_loc}
>>> Arguments: script\console
>>>
>>> Hope this helps
>>
>> Don't forget to Name the tool and apply changes.
>
> Thanks Rath.  I'm familiar with running the console from a windows
> command prompt (for example) but I'm trying to access the same feature
> in Rad Rails.  I took your suggestion about Eclipse and within RadRails,
> it seems as if you need to go to the Ruby 'perspective' to see 'Run'.
> But, under 'Run' ther is no option for External tools.  I've tried
> entering 'script/console' as an argument but I keep getting an error
> message - 'unable to load module'.  The strange thing is if I run
> script/generate, I get the help screen for 'generators', so at least
> script does work.  It's just the console side of things that isn't
> working.
> Thanks again.


**Update**
It did manage to work.  I went back to the terminal window (in RadRails)
and the environment loaded just fine.
Thanks for your help!
This topic is locked and can not be replied to.