This forum is no longer active. Please post your questions to our new community site

Rubyconsole returns bash prompt

Subscribe to Rubyconsole returns bash prompt 3 post(s), 2 voice(s)

 
Avatar CB 10 post(s)

I am on OSX 10.4.11 I opened a new terminal and tried to run rubyconsole like this:

cynthia-butlers-computer:~ Cindy$ /Applications/rubystack-1.1-0/rubyconsole
bash-2.05b$

As you can see it gives me a bash prompt.

Here is the content of the rubyconsole file:

!/bin/sh
PATH="/Applications/rubystack-1.1-0/common/bin:/Applications/rubystack-1.1-0/sqlite/bin:/Applications/rubystack-1.1-0/subversion/bin:/Applications/rubystack-1.1-0/common/bin:/Applications/rubystack-1.1-0/php/bin:/Applications/rubystack-1.1-0/mysql/bin:/Applications/rubystack-1.1-0/apache2/bin:/Applications/rubystack-1.1-0/ruby/bin:/usr/bin:/bin:/usr/sbin:/sbin"
alias mysql="mysql -S /mysql/tmp/mysql.sock"
exec /bin/bash --noprofile --norc

What do I need to change to get the rubyconsole file to work when I run it in terminal?

Thank you

 
Avatar Manuel 71 post(s)

Hi CB,

That’s the purpose of the rubyconsole script. It gives you a bash shell with all the corresponding environment variables loaded. I know, the name is a bit confusing.

If you wanted to get a Rails console for your Rails application, you must run the rubyconsole and then call script/console from your’s project directory. Assuming you left the default name for the sample application it should look like this:

cynthia-butlers-computer:~ Cindy$ /Applications/rubystack-1.1-0/rubyconsole
bash-2.05b$ cd /Applications/rubystack-1.1-0/projects/rubystack
bash-2.05b$ script/console
Loading development environment.
>>

regards

 
Avatar CB 10 post(s)

Thank you very much. This is just the explanation I needed. Now I finally understand.

And it works!

(Sorry for being such a newbie.)