Is your Ruby on rails application packed in a exe created by Rubyscript2Exe? Is Ruby2Exe not deleting the temp files once it is done? I came out with the solution of deleting the files of previous run:
1. Replace the contents of init.rb with this:
require "rubyscript2exe" require "fileutils" at_exit do require "irb" require "drb/acl" require "dbi" require "dbd/ODBC/ODBC" #Add the libraries you need end if RUBYSCRIPT2EXE.is_compiled? ee_base_folder = File.expand_path(RUBYSCRIPT2EXE.appdir + "/../..") ee_folder = File.expand_path(RUBYSCRIPT2EXE.appdir + "/..") name_parts = ee_folder.split(".") curr_ee_folder_number = name_parts[3].to_i last_ee_folder_number = curr_ee_folder_number - 1 Dir.entries(ee_base_folder).each do |folder| if (folder != ".") and (folder != "..") and (folder.split(".")[3].to_i != curr_ee_folder_number) folder_to_del = ee_base_folder + "/" + folder puts "deleting " + folder_to_del FileUtils.remove_dir(folder_to_del, true) end end end load "script/server"2. Before running your application make sure you run this windows batch command to delete the temporary files created by tar2script:
erase /F /S /Q "%USERPROFILE%\Local Settings\Temp\tar2rubyscript*.*"
Comments