Newbie: How to delete a Rails app (Windows)

Hi
Rails looks very neat but I need to delete some of my experiments

I know how to create an app:-

cd c:\rails
rails cookbook

but how do I delete? (If I just delete then I get a permissions
problem)

what about models controllers etc

Thanks alot

Peter

What gems has to do with application. If you want to delete app
just do it and create another one. Am'I missing something ?
Jacek Balcerski

···

peter.cutting@tetrapak.com wrote:

Hi
Rails looks very neat but I need to delete some of my experiments

I know how to create an app:-

cd c:\rails
rails cookbook

but how do I delete? (If I just delete then I get a permissions
problem)

what about models controllers etc

Thanks alot

Peter

but how do I delete? (If I just delete then I get a permissions
problem)

If you are on XP and you can't delete a folder, it is probably XP
being buggy. It tends to not like you deleting folders you've just
looked inside... sometimes the esiest answer is to log off, then log
back in, then delete the folder. That's my experience anyway.

To delete just a controller, or just a model, you'll have to go into
your project directory and delete the files you don't want anymore
manually. I don't believe generate modifies any files in the
directory, it just creates new ones. Delete 'em :slight_smile:

Douglas

Today. there doesnt seem to be a problem.sorry.

Douglas Livingstone, 2/2/2005 06:04:

but how do I delete? (If I just delete then I get a permissions
problem)

If you are on XP and you can't delete a folder, it is probably XP
being buggy. It tends to not like you deleting folders you've just
looked inside... sometimes the esiest answer is to log off, then log
back in, then delete the folder. That's my experience anyway.

The process may be running. XP don't let you delete something which is loaded in the memory. So he have to close the process before (Cntrl+Alt+Del, in the Process tab).

That'll be because you turned your somputer off overnight - same
effect as logging on then off.

Douglas

···

On Wed, 2 Feb 2005 18:35:48 +0900, peter.cutting@tetrapak.com <peter.cutting@tetrapak.com> wrote:

Today. there doesnt seem to be a problem.sorry.

yes the switching off may have helped (will try logging off next time
it happens). moving on

what process would that be. I would have thought that the only active
process would be the MySQL service. And of course any editors and or
command prompts I have open in the application directory. As far as I
can Ruby and Rails are not continually running processes.

Your webserver should also be running (which could also have the files
open, hence the permissions error).

···

On Wed, 2 Feb 2005 23:25:49 +0900, peter.cutting@tetrapak.com <peter.cutting@tetrapak.com> wrote:

yes the switching off may have helped (will try logging off next time
it happens). moving on

what process would that be. I would have thought that the only active
process would be the MySQL service. And of course any editors and or
command prompts I have open in the application directory. As far as I
can Ruby and Rails are not continually running processes.

Hello,
  I'm trying to understand how to use the test/unit methods and I haven't been able to learn them from:

http://www.rubygarden.org/ruby?UsingTestUnit
http://www.rubyconf.com/2001/talks/testinginreverse/
http://www.rubygarden.org/ruby?RubyTesting

  The first 2 are basically the same and don't work exactly the same on my Win 2K machine. My output is different than the examples at every stage, which is no big deal except at the end when the writer declares victory with no bugs and my output still complains of errors. Can someone point me to a (gentler/more complete) link that would take me through the learning curve and, ideally, even work on Windows?
  Thanks,
    Barry

The process may be running. XP don't let you delete something which

>> is loaded in the memory. So he have to close the process before
>> (Cntrl+Alt+Del, in the Process tab).

> what process would that be

I like this program:

  WhoLockMe Explorer Extension v2.0 beta (NT-Win2K-XP) download page

It tells you which process has locked a particular file or folder.

// Niklas

> what process would that be.

Your webserver should also be running (which could also have the files
open, hence the permissions error).

It happens when the flder apperas empty too.

Thry this:
1. Create a new folder on the desktop
2. Right click, then "new-> bitmap image"
3. Right click on the image, select edit
4. Put something into the image, save it. Close you image editing program
5. Turn on thumbnail view
6. Try and delete the folder by draging it to the recycle bin, keeping
the view of the folder open (won't work)

Think that it is the image still in use?

7. Delete the image from the folder (will work)
9. Close the view of the folder
8. Folder is now "empty" but you still can't delete it.

Douglas

Hello,
  I'm trying to understand how to use the test/unit methods and I haven't been able to learn them from:

         [...]

  Can someone point me to a (gentler/more complete) link that would take me through the learning curve and, ideally, even work on Windows?

Depends which bits you are trying to get your mind around. If it is
the acual examples, then it might be worth posting the code you had,
what you got, and what you expected. If it is this whole "unit
testing thing", then much of what I wrote and linked to at

http://www.eng.cse.dmu.ac.uk/~hgs/ruby/ruby-unit.html

is probably still useful, and it contains some links to Test Unit
intormation, although it is principally about Ruby Unit, which
predates Test Unit. I've no plans/time/energy to update this in the
*immediate* future, though I see a need for doing so at some point.

  Thanks,
    Barry

         HTH
         Hugh

···

On Thu, 3 Feb 2005, Barry Sperling wrote:

PS: tested on WinXP Pro SP2

···

On Wed, 2 Feb 2005 15:31:16 +0000, Douglas Livingstone <rampant@gmail.com> wrote:

> > what process would that be.
>
> Your webserver should also be running (which could also have the files
> open, hence the permissions error).
>

It happens when the flder apperas empty too.

Thry this:
1. Create a new folder on the desktop
2. Right click, then "new-> bitmap image"
3. Right click on the image, select edit
4. Put something into the image, save it. Close you image editing program
5. Turn on thumbnail view
6. Try and delete the folder by draging it to the recycle bin, keeping
the view of the folder open (won't work)

Think that it is the image still in use?

7. Delete the image from the folder (will work)
9. Close the view of the folder
8. Folder is now "empty" but you still can't delete it.

Douglas

Hugh Sasse Staff Elec Eng wrote:

> Depends which bits you are trying to get your mind around. If it is
> the acual examples, then it might be worth posting the code you had,
> what you got, and what you expected.

Thanks, I'll take a look at your link!

As an example of the differences, this is what the writer of the Ruby Garden tutorial had at the end:

  C:\projects-ruby\Sandbox>ruby tc_string_wrapper.rb
  Loaded suite tc_string_wrapper
  Started...
  ..
  Finished in 0.01 seconds.
  1 runs, 1 assertions, 0 failures, 0 errors

And this is what I got running it in Scite:

Loaded suite Test_Unit.rbw
Started
F
Finished in 0.05 seconds.

   1) Failure:
test_wrap(TC_StringWrapper) [Test_Unit.rbw:11]:
The line should have been wrapped to 9 columns.
<"This is a\nwrapped\nline."> expected but was
<"">.

1 tests, 1 assertions, 1 failures, 0 errors
>Exit code: 1

Any thoughts, or other links, would be appreciated.
  Barry

···

If it is this whole "unit
testing thing", then much of what I wrote and linked to at

http://www.eng.cse.dmu.ac.uk/~hgs/ruby/ruby-unit.html

is probably still useful, and it contains some links to Test Unit
intormation, although it is principally about Ruby Unit, which
predates Test Unit. I've no plans/time/energy to update this in the
*immediate* future, though I see a need for doing so at some point.

        HTH
        Hugh

Douglas Livingstone wrote:

It happens when the flder apperas empty too.

Thry this:
1. Create a new folder on the desktop
2. Right click, then "new-> bitmap image"
3. Right click on the image, select edit
4. Put something into the image, save it. Close you image editing program
5. Turn on thumbnail view
6. Try and delete the folder by draging it to the recycle bin, keeping
the view of the folder open (won't work)

Think that it is the image still in use?

7. Delete the image from the folder (will work)
9. Close the view of the folder
8. Folder is now "empty" but you still can't delete it.

This has been my experience with Windows 2000 and Windows XP as well.

Microsoft has a technote which purports to describe all cases of why you cannot delete a file or folder in the following technote:

I have never been convinced that this covers everything.

If you really want to see if some process has handles open before your delete, go to http://www.sysinternals.com and download their process explorer app and/or their Handles program.

I have always thought that there was some deep level of caching happening, or perhaps a side effect of various file level driver hooks (e.g. Anti Virus programs etc...).

In any case, I concur that if you run into this and it is not because you have a program or service which has a handle open on the file, that a simple log off and log on will clear it up.

Sigh.

And this is what I got running it in Scite:

I don't use Scite, so can't be sure how this interacts.
Presumably you get the same results outside of Scite?

Loaded suite Test_Unit.rbw
Started
F
Finished in 0.05 seconds.

1) Failure:
test_wrap(TC_StringWrapper) [Test_Unit.rbw:11]:
The line should have been wrapped to 9 columns.
<"This is a\nwrapped\nline."> expected but was
<"">.

1 tests, 1 assertions, 1 failures, 0 errors

Exit code: 1

We'd really need to see your code to be able to reproduce this, and
to be sure that it doesn't differ significantly from the example.
We could probably do with knowing what versions of Ruby and Test Unit
you are using.

All we can say now is that it is clear the assert statement is
getting an empty string, but from what I can's see.

Any thoughts, or other links, would be appreciated.
  Barry

         Hugh

···

On Thu, 3 Feb 2005, Barry Sperling wrote:

Explorer in Windows XP has a definite problem releasing file handles... Rebooting does clear this up, but I tend to use ProcExplorer to search and close them so I don't have to...

Cheers,
Tim

eg wrote:

···

Douglas Livingstone wrote:

It happens when the flder apperas empty too.

Thry this:
1. Create a new folder on the desktop
2. Right click, then "new-> bitmap image"
3. Right click on the image, select edit
4. Put something into the image, save it. Close you image editing program
5. Turn on thumbnail view
6. Try and delete the folder by draging it to the recycle bin, keeping
the view of the folder open (won't work)

Think that it is the image still in use?

7. Delete the image from the folder (will work)
9. Close the view of the folder
8. Folder is now "empty" but you still can't delete it.

This has been my experience with Windows 2000 and Windows XP as well.

Microsoft has a technote which purports to describe all cases of why you cannot delete a file or folder in the following technote:

Microsoft Support

I have never been convinced that this covers everything.

If you really want to see if some process has handles open before your delete, go to http://www.sysinternals.com and download their process explorer app and/or their Handles program.

I have always thought that there was some deep level of caching happening, or perhaps a side effect of various file level driver hooks (e.g. Anti Virus programs etc...).

In any case, I concur that if you run into this and it is not because you have a program or service which has a handle open on the file, that a simple log off and log on will clear it up.

Sigh.

Hi Hugh,

Hugh Sasse Staff Elec Eng wrote:

I don't use Scite, so can't be sure how this interacts.
Presumably you get the same results outside of Scite?

Yes, when I used it on the command line as:
e:\ruby\scite\ruby test_unit.rbw

I got the same error.

Loaded suite Test_Unit.rbw
Started
F
Finished in 0.05 seconds.

1) Failure:
test_wrap(TC_StringWrapper) [Test_Unit.rbw:11]:
The line should have been wrapped to 9 columns.
<"This is a\nwrapped\nline."> expected but was
<"">.

1 tests, 1 assertions, 1 failures, 0 errors

Exit code: 1

We'd really need to see your code to be able to reproduce this, and
to be sure that it doesn't differ significantly from the example.

require 'test/unit'
require 'string_wrapper' #NOTE: I ALSO TRIED _.RB AND _.RBW HERE

class TC_StringWrapper < Test::Unit::TestCase
   def test_wrap
  wrapper = StringWrapper.new
  assert_equal("This is a\nwrapped\nline.",
                   wrapper.wrap("This is a wrapped line.", 9),
                   "The line should have been wrapped to 9 columns")
   end
end

and string_wrapper.rbw ( also made a string_wrapper.rb just to be sure ):

class StringWrapper
  def wrap( string, columns )
    string.scan(/(.{1,9}) (?: |$)/).join("\n")
  end
end

We could probably do with knowing what versions of Ruby and Test Unit
you are using.

Ruby 1.8.2 and whatever Test Unit comes with it.

All we can say now is that it is clear the assert statement is
getting an empty string, but from what I can's see.

Any thoughts, or other links, would be appreciated.

Thanks for your link, and I'm currently looking at:

http://www.ruby-doc.org/stdlib/libdoc/test/unit/rdoc/index.html

The example there with:

require 'test/unit'
class TC_MYTest < Test::Unit::TestCase
  def test_fail
    assert(false, 'Assertion was false.')
  end
end

works as stated. But I need some more hand holding to get it to judge my own work.
Thanks,
  Barry

Hi Hugh,

Hugh Sasse Staff Elec Eng wrote:

I don't use Scite, so can't be sure how this interacts.
Presumably you get the same results outside of Scite?

Yes, when I used it on the command line as:
e:\ruby\scite\ruby test_unit.rbw

I got the same error.

         [...]

1) Failure:
test_wrap(TC_StringWrapper) [Test_Unit.rbw:11]:
The line should have been wrapped to 9 columns.
<"This is a\nwrapped\nline."> expected but was
<"">.

1 tests, 1 assertions, 1 failures, 0 errors

Exit code: 1

We'd really need to see your code to be able to reproduce this, and
to be sure that it doesn't differ significantly from the example.

require 'test/unit'
require 'string_wrapper' #NOTE: I ALSO TRIED _.RB AND _.RBW HERE

class TC_StringWrapper < Test::Unit::TestCase
def test_wrap
  wrapper = StringWrapper.new
  assert_equal("This is a\nwrapped\nline.",
                 wrapper.wrap("This is a wrapped line.", 9),
                 "The line should have been wrapped to 9 columns")
end
end

and string_wrapper.rbw ( also made a string_wrapper.rb just to be sure ):

class StringWrapper
  def wrap( string, columns )
    string.scan(/(.{1,9}) (?: |$)/).join("\n")

Should be
      string.scan(/(.{1,9})(?: |$)/).join("\n")
i.e no space between ) and ( because the regular expression will look
for that space.

  end
end

And I think you get an empty string because
/.{1,9) / and /.{1,9} $/ never match the input. There is no double
space, and there is no [space][end of line], / $/.

We could probably do with knowing what versions of Ruby and Test Unit
you are using.

Ruby 1.8.2 and whatever Test Unit comes with it.

Thanks

All we can say now is that it is clear the assert statement is
getting an empty string, but from what I can's see.

Any thoughts, or other links, would be appreciated.

Thanks for your link, and I'm currently looking at:

http://www.ruby-doc.org/stdlib/libdoc/test/unit/rdoc/index.html

The example there with:

         [...]

    assert(false, 'Assertion was false.')

         [...]

works as stated. But I need some more hand holding to get it to judge my own work.
Thanks,
  Barry

         HTH
         Hugh

···

On Thu, 3 Feb 2005, Barry Sperling wrote:

Thank you!
  The "space" was an error and it now runs correctly. FWIW, an earlier error (yesterday) was leaving out the "require" for the file that held the StringWrapper class. Now if I could only figure out what is going

···

on here... Barry Hugh Sasse Staff Elec Eng wrote:

On Thu, 3 Feb 2005, Barry Sperling wrote:

Hi Hugh,

Hugh Sasse Staff Elec Eng wrote:

I don't use Scite, so can't be sure how this interacts.
Presumably you get the same results outside of Scite?

Yes, when I used it on the command line as:
e:\ruby\scite\ruby test_unit.rbw

I got the same error.

        [...]

1) Failure:
test_wrap(TC_StringWrapper) [Test_Unit.rbw:11]:
The line should have been wrapped to 9 columns.
<"This is a\nwrapped\nline."> expected but was
<"">.

1 tests, 1 assertions, 1 failures, 0 errors

Exit code: 1

We'd really need to see your code to be able to reproduce this, and
to be sure that it doesn't differ significantly from the example.

require 'test/unit'
require 'string_wrapper' #NOTE: I ALSO TRIED _.RB AND _.RBW HERE

class TC_StringWrapper < Test::Unit::TestCase
def test_wrap
    wrapper = StringWrapper.new
    assert_equal("This is a\nwrapped\nline.",
                 wrapper.wrap("This is a wrapped line.", 9),
                 "The line should have been wrapped to 9 columns")
end
end

and string_wrapper.rbw ( also made a string_wrapper.rb just to be sure ):

class StringWrapper
    def wrap( string, columns )
        string.scan(/(.{1,9}) (?: |$)/).join("\n")

Should be
         string.scan(/(.{1,9})(?: |$)/).join("\n")
i.e no space between ) and ( because the regular expression will look
for that space.

    end
end

And I think you get an empty string because
/.{1,9) / and /.{1,9} $/ never match the input. There is no double
space, and there is no [space][end of line], / $/.

We could probably do with knowing what versions of Ruby and Test Unit
you are using.

Ruby 1.8.2 and whatever Test Unit comes with it.

Thanks

All we can say now is that it is clear the assert statement is
getting an empty string, but from what I can's see.

Any thoughts, or other links, would be appreciated.

Thanks for your link, and I'm currently looking at:

http://www.ruby-doc.org/stdlib/libdoc/test/unit/rdoc/index.html

The example there with:

        [...]

        assert(false, 'Assertion was false.')

        [...]

works as stated. But I need some more hand holding to get it to judge my own work.
Thanks,
    Barry

        HTH
        Hugh