From: RichardOnRails on
Hi,

I decided to create a batch file to build a RubyOnRails application
step-by-step. I want to take this approach so that I'd have a
reproducible build process.

After a couple of commands to switch to the required working
directory, the first substantive Rails command was invoked. It's a
command that's always worked reliably for me and I believe many Rails
programmers. Judging by its output, I believe it worked correctly
from this batch-file invocation. But the immediately following
command was not executed. I'd like to find out why.

Below is version stripped of most of the things relevant to this
problem: The Command Window output is provided also.

Thanks in Advance,
Richard

K:
cd K:\_Projects\Ruby\_Rails_Apps\_EIMS
if "%1" == "run" goto step1_run

:step1_run
rails RTS2 –d mysql
@echo RTS2 creation completed
goto remaining_steps

:remaing_steps
@echo ----
@ echo Beginning remainining steps
@ echo ---
ruby generate/scaffold Expense vendor:string description:string
category:string account:string amount:decimal mode:string
tran_date:date user_id:decimal

======== Command Window ======
C:\>GenerateRailsAppX run

C:\>K:

K:\>cd K:\_Projects\Ruby\_Rails_Apps\_EIMS

K:\_Projects\Ruby\_Rails_Apps\_EIMS>if "run" == "run" goto step1_run

K:\_Projects\Ruby\_Rails_Apps\_EIMS>rails RTS2 ûd mysql
exists
exists app/controllers
exists app/helpers
exists app/models
exists app/views/layouts
exists config/environments
exists config/initializers
[snip]
identical doc/README_FOR_APP
identical log/server.log
identical log/production.log
identical log/development.log
identical log/test.log

K:\_Projects\Ruby\_Rails_Apps\_EIMS>

NOTE: The echo command immediately following the Rails command never
displayed it's content.
From: Randem on
Long time since I did batch programming but try this:

cmd /c rails RTS2 �d mysql

--
The Top Script Generator for Jordan Russell's Inno Setup -
http://www.randem.com/innoscript.html
Free Utilities and Code - http://www.randem.com/freesoftutil.html
"RichardOnRails" <RichardDummyMailbox58407(a)USComputerGurus.com> wrote in
message
news:b7201302-11a5-4382-b362-546dd21ce2c5(a)d16g2000yqb.googlegroups.com...
Hi,

I decided to create a batch file to build a RubyOnRails application
step-by-step. I want to take this approach so that I'd have a
reproducible build process.

After a couple of commands to switch to the required working
directory, the first substantive Rails command was invoked. It's a
command that's always worked reliably for me and I believe many Rails
programmers. Judging by its output, I believe it worked correctly
from this batch-file invocation. But the immediately following
command was not executed. I'd like to find out why.

Below is version stripped of most of the things relevant to this
problem: The Command Window output is provided also.

Thanks in Advance,
Richard

K:
cd K:\_Projects\Ruby\_Rails_Apps\_EIMS
if "%1" == "run" goto step1_run

:step1_run
rails RTS2 �d mysql
@echo RTS2 creation completed
goto remaining_steps

:remaing_steps
@echo ----
@ echo Beginning remainining steps
@ echo ---
ruby generate/scaffold Expense vendor:string description:string
category:string account:string amount:decimal mode:string
tran_date:date user_id:decimal

======== Command Window ======
C:\>GenerateRailsAppX run

C:\>K:

K:\>cd K:\_Projects\Ruby\_Rails_Apps\_EIMS

K:\_Projects\Ruby\_Rails_Apps\_EIMS>if "run" == "run" goto step1_run

K:\_Projects\Ruby\_Rails_Apps\_EIMS>rails RTS2 �d mysql
exists
exists app/controllers
exists app/helpers
exists app/models
exists app/views/layouts
exists config/environments
exists config/initializers
[snip]
identical doc/README_FOR_APP
identical log/server.log
identical log/production.log
identical log/development.log
identical log/test.log

K:\_Projects\Ruby\_Rails_Apps\_EIMS>

NOTE: The echo command immediately following the Rails command never
displayed it's content.


From: Mike S on
On 7/8/2010 6:02 PM, Randem wrote:
> Long time since I did batch programming but try this:
>
> cmd /c rails RTS2 �d mysql


What do you make of the fact that your command was:

RTS2 �d mysql

And the response was:

rails RTS2 �d mysql

Do you need to use quotation marks, or is there some other way to invoke
the same flag?


From: Randem on
Yes, try quotation marks

cmd /c "rails RTS2 -d mysql"

--
The Top Script Generator for Jordan Russell's Inno Setup -
http://www.randem.com/innoscript.html
Free Utilities and Code - http://www.randem.com/freesoftutil.html
"Mike S" <mscir(a)yahoo.com> wrote in message
news:i160b6$omq$1(a)news.eternal-september.org...
> On 7/8/2010 6:02 PM, Randem wrote:
>> Long time since I did batch programming but try this:
>>
>> cmd /c rails RTS2 �d mysql
>
>
> What do you make of the fact that your command was:
>
> RTS2 �d mysql
>
> And the response was:
>
> rails RTS2 �d mysql
>
> Do you need to use quotation marks, or is there some other way to invoke
> the same flag?
>
>


From: Pegasus [MVP] on


"RichardOnRails" <RichardDummyMailbox58407(a)USComputerGurus.com> wrote in
message
news:b7201302-11a5-4382-b362-546dd21ce2c5(a)d16g2000yqb.googlegroups.com...
> Hi,
>
> I decided to create a batch file to build a RubyOnRails application
> step-by-step. I want to take this approach so that I'd have a
> reproducible build process.
>
> After a couple of commands to switch to the required working
> directory, the first substantive Rails command was invoked. It's a
> command that's always worked reliably for me and I believe many Rails
> programmers. Judging by its output, I believe it worked correctly
> from this batch-file invocation. But the immediately following
> command was not executed. I'd like to find out why.
>
> Below is version stripped of most of the things relevant to this
> problem: The Command Window output is provided also.
>
> Thanks in Advance,
> Richard
>
> K:
> cd K:\_Projects\Ruby\_Rails_Apps\_EIMS
> if "%1" == "run" goto step1_run
>
> :step1_run
> rails RTS2 �d mysql
> @echo RTS2 creation completed
> goto remaining_steps
>
> :remaing_steps
> @echo ----
> @ echo Beginning remainining steps
> @ echo ---
> ruby generate/scaffold Expense vendor:string description:string
> category:string account:string amount:decimal mode:string
> tran_date:date user_id:decimal
>
> ======== Command Window ======
> C:\>GenerateRailsAppX run
>
> C:\>K:
>
> K:\>cd K:\_Projects\Ruby\_Rails_Apps\_EIMS
>
> K:\_Projects\Ruby\_Rails_Apps\_EIMS>if "run" == "run" goto step1_run
>
> K:\_Projects\Ruby\_Rails_Apps\_EIMS>rails RTS2 �d mysql
> exists
> exists app/controllers
> exists app/helpers
> exists app/models
> exists app/views/layouts
> exists config/environments
> exists config/initializers
> [snip]
> identical doc/README_FOR_APP
> identical log/server.log
> identical log/production.log
> identical log/development.log
> identical log/test.log
>
> K:\_Projects\Ruby\_Rails_Apps\_EIMS>
>
> NOTE: The echo command immediately following the Rails command never
> displayed it's content.

Some executables return control to the invoking batch file immediately after
being invoked. Others only do it after they themselves finish. It depends on
how they are written. Rails.exe appears to belong to the second class. You
can get around the issue like so:

start /b rails RTS2 �d mysql

A more robust approach would look like this (because it specifies the full
path to rails.exe):

start /b "Ruby on Rails" /d "c:\Program Files\Rails" rails.exe RTS2 �d
mysql



 |  Next  |  Last
Pages: 1 2 3
Prev: google chrome X win xp
Next: last test