Rad Rails and rails console

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!

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!

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 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 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!

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.