Ruby and Terminal - why didn't anyone explain this?


#1

I’m learning RoR. I’ve been using PHP for 6 years now. I bought the
new Agile Web Dev With Rails book and it took me about 9 hours to get
the first project going. No where did it, or anywhere else explain
the whole terminal inputs. It just said to open your “shell”… What is
the deal with those, why do I have to use them, and why can’t it be
just simple text files like PHP?


#2

On 21 Apr., 00:42, “removed_email_address@domain.invalid” removed_email_address@domain.invalid wrote:

I’m learning RoR. I’ve been using PHP for 6 years now. I bought the
new Agile Web Dev With Rails book and it took me about 9 hours to get
the first project going. No where did it, or anywhere else explain
the whole terminal inputs. It just said to open your “shell”… What is
the deal with those, why do I have to use them, and why can’t it be
just simple text files like PHP?

Well, you do use “simple text files”, just like in PHP. The difference
between PHP and Rails, though, is that the only thing you need to do
in PHP is to download a package like xampp (e.g.) and just put your
files in the right directory. In Rails, there is a predefined
directory structure, so you’ll need to generate Rails projects in the
shell
. And you have to actively start the server in the shell to
view your application in the browser. Also when you generate models
and controllers you go to the shell and type the respective
commands.

As you can see, Rails uses the shell to stop you from repeating
yourself and thereby it speeds up your development process. The reason
why no one has explained this to you, could be because most Rails
developers works in operating systems like Ubuntu (Linux) or Mac OS
where the shell/terminal/command line is a completely natural place to
be, in contrast to on Windows systems where most things are done via
graphical interfaces.

I hope you understand, and I also hope you’ll come to appreciate the
power of the shell.


Best regards,
David K.
http://twitter.com/perplect


#3

On Apr 21, 10:04 am, Marnen Laibow-Koser <rails-mailing-l…@andreas-
s.net> wrote:

removed_email_address@domain.invalid wrote:

I’m learning RoR. I’ve been using PHP for 6 years now.
[…]
It just said to open your “shell”… What is
the deal with those,

Are you trying to say that in 6 years of PHP development, you haven’t
touched a command line, and don’t even really know what one is?

Wait till he finds out about source control…

–Matt J.


#4

removed_email_address@domain.invalid wrote:

I’m learning RoR. I’ve been using PHP for 6 years now.
[…]
It just said to open your “shell”… What is
the deal with those,

Are you trying to say that in 6 years of PHP development, you haven’t
touched a command line, and don’t even really know what one is? How do
you install modules, then?

why do I have to use them,

You don’t. Rails just provides a bunch of shell commands to make your
life easier. You could ignore them all if you really wanted to,
although your productivity would suffer.

and why can’t it be
just simple text files like PHP?

It is just simple text files. Whatever made you think otherwise?

Note that some PHP frameworks (such as Symfony) take a similar approach
to use of the command line.

Does this help, or is there an issue here I’m not getting?

Best,

Marnen Laibow-Koser
http://www.marnen.org
removed_email_address@domain.invalid


#5

Hmm… I just typed in, “script/server RAILS_ENG=development” and it
fixed my problems. Why would that be?


#6

Thanks a lot guys!.. I’m SLOWLY getting familiar with the shell.

Maybe I should start another topic for this… but:
My ruby isn’t working anymore!
In the last few hours I deleted some random ruby files on my main user
folder (mac OSX) because I think I accidentally installed a rails app
there and wanted to get rid of the files. I also installed and
reinstalled mysql.

Since then, ruby is not working. No controllers are working at all,
even old ones I had looked at before. On the homepage (localhost:3000)
I get this message when I click the about link: “We’re sorry, but
something went wrong.”
Also when I visit my controller url I get this: “We’re sorry, but
something went wrong.”

Thanks for all the help!