larsch / ocra

One-Click Ruby Application Builder
http://ocra.rubyforge.org/
833 stars 84 forks source link

trying to download a photo #143

Open bolahanna44 opened 5 years ago

bolahanna44 commented 5 years ago

hello i was trying to download a photo with the following code but not working

require 'open-uri'
download = open('https://www.southernexposure.com/images/medium/okra-lee_MED.jpg')
IO.copy_stream(download, './image.png')

the exe file is generated successfully here is the output during generation

E:\test ocra>ocra test.rb --windows === Loading script to check dependencies === Attempting to trigger autoload of Gem::ConfigFile === Attempting to trigger autoload of Gem::DependencyList === Attempting to trigger autoload of Gem::DependencyResolver === Attempting to trigger autoload of Gem::Installer === Attempting to trigger autoload of Gem::Licenses === Attempting to trigger autoload of Gem::Source === Attempting to trigger autoload of Gem::RequestSet === Attempting to trigger autoload of Gem::SpecFetcher === Attempting to trigger autoload of Gem::SourceList === Attempting to trigger autoload of RubyInstaller::Runtime::Components::Base === WARNING: RubyInstaller::Runtime::Components::Base was defined autoloadable, but caused NameError === Attempting to trigger autoload of RubyInstaller::Runtime::Colors === Attempting to trigger autoload of RubyInstaller::Runtime::ComponentsInstalle r === Attempting to trigger autoload of RubyInstaller::Runtime::Ridk === Attempting to trigger autoload of RubyInstaller::Runtime::PACKAGE_VERSION === Attempting to trigger autoload of CGI::HtmlExtension === Detected gem did_you_mean-1.1.0 (loaded, files) === 14 files, 32780 bytes === Detected gem ocra-1.3.10 (loaded, files) === 5 files, 210830 bytes === Detected gem io-console-0.4.6 (loaded, files) === WARNING: Gem io-console-0.4.6 root folder was not found, skipping === Detected gem openssl-2.0.9 (loaded, files) === WARNING: Gem openssl-2.0.9 root folder was not found, skipping === Detected gem rake-12.0.0 (loaded, files) === 43 files, 111973 bytes === Including 59 encoding support files (3785728 bytes, use --no-enc to exclude)

=== Building test.exe === Adding user-supplied source files === Adding ruby executable rubyw.exe === Adding detected DLL C:/Ruby24-x64/bin/ruby_builtin_dlls/libgmp-10.dll === Adding detected DLL C:/Ruby24-x64/bin/ruby_builtin_dlls/libffi-6.dll === Adding detected DLL C:/Ruby24-x64/bin/ruby_builtin_dlls/LIBEAY32.dll === Adding detected DLL C:/Ruby24-x64/bin/ruby_builtin_dlls/SSLEAY32.dll === Adding detected DLL C:/Ruby24-x64/bin/ruby_builtin_dlls/ZLIB1.dll === Adding external manifest C:/Ruby24-x64/bin/ruby_builtin_dlls/ruby_builtin_dl ls.manifest === Adding library files === Compressing 12683315 bytes

LZMA 4.65 : Igor Pavlov : Public domain : 2009-02-03 === Finished building test.exe (3394460 bytes)

damian-m-g commented 5 years ago

You need to provide more information. Does it happens without compiling with ocra too? Try to compile without --windows and run it from the console to see if some error gets dropped.

bolahanna44 commented 5 years ago

when it compile with ocra during exe generation it works good and image is being downloaded but after clicking the exe file the screen open and disappear immediately and the image is not downloaded

damian-m-g commented 5 years ago

Yeah, but don't double click it, cast it from the console, so if an error gets dropped you can actually see it.