Reply to topic
Rails on windows
comprug
Forum Regular

Joined: 15 Feb 2006
Posts: 347
Reply with quote
Hmm... you're running rails on windows..try the full path, but unfortunately I have little experience with rails on windows.
pmeserve
HostMySite Tech

Joined: 19 Mar 2004
Posts: 178
Reply with quote
Use the full path to the file, or for something a little less machine-specific, start with RAILS_ROOT, e.g.;

Code:
File.open("#{RAILS_ROOT}/public/stylesheets/wolf.css", "a") { |t| t.puts txt }

I believe this will work with forward slashes on Windows, but try back-slashes if not. If it still doesn't work, just output that path to the screen to make sure it matches what you expect

BTW, when working with files,
Code:
FileTest.exists?
comes in handy a lot - does exactly what you'd think
Help Editing Record
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 2 of 2  

  
  
 Reply to topic