shoes / shoes3

a tiny graphical app kit for ruby
http://walkabout.mvmanila.com
Other
180 stars 19 forks source link

No such file or directory @ rb_sysopen - packaged on windows #135

Closed aarmora closed 9 years ago

aarmora commented 9 years ago

I'm using shoes-3.2.23-gtk2-32.

I've tried to package my app with and without shoes ('download as needed' and 'include shoes'). I packaged it from the GUI.

Error in <unknown> line 0 | 2015-07-02 03:41:05 +0000
No such file or directory @ rb_sysopen - scraper.rb
C:/Program Files (x86)/Shoes/lib/shoes.rb:517:in `read'
C:/Program Files (x86)/Shoes/lib/shoes.rb:517:in `read_file'
C:/Program Files (x86)/Shoes/lib/shoes.rb:496:in `visit'
eval:1:in `<main>'
ccoupe commented 9 years ago

Reference: the old site https://github.com/shoes/shoes/issues/275#issuecomment-117877223

Jordan. Thanks for the bug report. I just tried packaging my test app for Windows (download if needed) . Works fine - http://walkabout.mvmanila.com/public/share/isp.exe (Shoes 3.2.23) please try it to see if it loads properly for you. I misspoke about where single scripts are expanded to -- it's in %HOME% - that's a bug but it's not the bug you're reporting.

Please make sure you don't have old or multiple versions of Shoes installed - Windows and Shoes can get very confused if there are multiple copies.

aarmora commented 9 years ago

Hey Cecil,

Thanks for your time. I currently don't have shoes installed on the computer I just ran that program on. It gave me the same error.

Error in <unknown> line 0 | 2015-07-02 08:07:12 +0000
No such file or directory @ rb_sysopen - isp.rb
C:/Program Files (x86)/Shoes/lib/shoes.rb:517:in `read'
C:/Program Files (x86)/Shoes/lib/shoes.rb:517:in `read_file'
C:/Program Files (x86)/Shoes/lib/shoes.rb:496:in `visit'
eval:1:in `<main>'

Thanks,

Jordan

On Wed, Jul 1, 2015 at 11:05 PM, Cecil Coupe notifications@github.com wrote:

Reference: the old site shoes#275 (comment) https://github.com/shoes/shoes/issues/275#issuecomment-117877223

Jordan. Thanks for the bug report. I just tried packaging my test app for Windows (download if needed) . Works fine - http://walkabout.mvmanila.com/public/share/isp.exe (Shoes 3.2.23) please try it to see if it loads properly for you. I misspoke about where single scripts are expanded to -- it's in %HOME% - that's bug but it's not your bug.

Please make sure you don't have old or multiple versions of Shoes installed - Windows and Shoes can get very confused if there are multiple copies.

— Reply to this email directly or view it on GitHub https://github.com/Shoes3/shoes3/issues/135#issuecomment-117907871.

ccoupe commented 9 years ago

There is something about your Windows that is different than mine. I use Win 7 and Shoes does run on 8 and 8.1 (I'm told). Some folks have had installation problems with certain anti-virus code but your stack trace indicates it did download and install Shoes. Still, try turning off your AV just long enough to see if that is the problem.

Another possibility: does your home directory have a space in the folder name?

After it fails you should have a complete Shoes installed on the system. Try using it to run the isp.rb (or your scraper.rb) that is left behind after the failure - You can search for the file if needed. Check your PATH. Shoes does add to PATH so you can type shoes.exe or cshoes.exe on the command line.

aarmora commented 9 years ago

Sorry, I feel like I should have clarified. I've installed shoes and ran this application with shoes before I packaged it. The error only happens after I package and try to run the executable.

Thanks,

Jordan

On Jul 2, 2015, at 11:29 AM, Cecil Coupe notifications@github.com wrote:

There is something about your Windows that is different than mine. I use Win 7 and Shoes does run on 8 and 8.1 (I'm told). Some folks have had installation problems with certain anti-virus code but your stack trace indicates it did download and install Shoes. Still, try turning off your AV just long enough to see if that is the problem.

Another possibility: does your home directory have a space in the folder name?

After it fails you should have a complete Shoes installed on the system. Try using it to run the isp.rb (or your scraper.rb) that is left behind after the failure - You can search for the file if needed. Check your PATH. Shoes does add to PATH so you can type shoes.exe or cshoes.exe on the command line.

— Reply to this email directly or view it on GitHub.

ccoupe commented 9 years ago

I understand. My isp.exe and your scraper.exe both fail to run on your test system but my isp.exe runs on my test system, Since I wrote or heavily modified a lot of the code involved with this part of Shoes I've got a good feel for what could be tripping it up on your Windows but not mine.

ccoupe commented 9 years ago

Be aware of how packaging works. isp.exe will check to see if Shoes is installed. If not, it will install Shoes (download) or copy from inside the .exe. Shoes will always be installed on the test system or the end users system. Then the exe code tells Shoes to run the script packed in the exe.

aarmora commented 9 years ago

Cecil,

I tried the tests you suggested and no luck yet. I've included a search for shoes so you can see the path. I don't believe my %HOME% has a space in it if I'm understanding correctly.

I turned off the AV and it still did not do anything differently.

I ran shoes from the PATH and opened the app and it worked perfectly. It's only when I use the executable that it fails.

What else can I test? Thanks again for your time,

Jordan

On Thu, Jul 2, 2015 at 2:12 PM, Cecil Coupe notifications@github.com wrote:

Be aware of how packaging works. isp.exe will check to see if Shoes is installed. If not, it will install Shoes (download) or copy from inside the .exe. Shoes will always be installed on the test system or the end users system. Then the exe code tells Shoes to run the script packed in the exe.

— Reply to this email directly or view it on GitHub https://github.com/Shoes3/shoes3/issues/135#issuecomment-118152942.

ccoupe commented 9 years ago

Truly mysterious. It's got to be something different in your Windows that Shoes is mishandling. For attachments to github you have to use the website. I really want to know where the isp.rb or scraper.rb file is when the exe is run and the stack trace is still displayed. Also lets find out where things are set. From the command line the important variables are env-capture

ccoupe commented 9 years ago

Are there network drives involved?

aarmora commented 9 years ago

C:\Users\Jordan>set HOME HOMEDRIVE=C: HOMEPATH=\Users\Jordan

C:\Users\Jordan>set APPDATA APPDATA=C:\Users\Jordan\AppData\Roaming

C:\Users\Jordan>set LOCALAPPDATA LOCALAPPDATA=C:\Users\Jordan\AppData\Local

C:\Users\Jordan>set PATH Path=C:\Users\Jordan\AppData\Roaming\npm;C:\Program Files\nodejs\;C:\Program Fil es\Haskell\bin;C:\Program Files\Haskell Platform\2014.2.0.0\lib\extralibs\bin;C: \Program Files\Haskell Platform\2014.2.0.0\bin;C:\WINDOWS\system32;C:\WINDOWS;C: \WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Fi les (x86)\Intel\OpenCL SDK\3.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\3 .0\bin\x64;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\ WirelessCommon\;C:\Program Files (x86)\Git\cmd;C:\Program Files (x86)\Git\bin;C: \Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Fi les\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SDKs\T ypeScript\1.0\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files (x86)\Skype\Phone\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\B inn\VSShell\Common7\IDE\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\B inn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files (x86 )\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\Haskell Platform\2014.2.0. 0\mingw\bin;C:\Program Files (x86)\Brackets\command;C:\Program Files\nodejs\;C:\ Program Files (x86)\Shoes;C:\Users\Jordan\AppData\Roaming\cabal\bin;C:\Users\Jor dan\AppData\Roaming\npm PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC

I'll attach the image from the website now.

Thanks,

Jordan

On Thu, Jul 2, 2015 at 6:20 PM, Cecil Coupe notifications@github.com wrote:

Truly mysterious. It's got to be something different in your Windows that Shoes is mishandling. For attachments to github you have to use the website. I really want to know where the isp.rb or scraper.rb file is when the exe is run and the stack trace is still displayed. Also lets find out where things are set. From the command line the important variables are [image: env-capture] https://cloud.githubusercontent.com/assets/222691/8490478/f3391dcc-20e6-11e5-84dd-bf95b937b59a.PNG

— Reply to this email directly or view it on GitHub https://github.com/Shoes3/shoes3/issues/135#issuecomment-118200975.

aarmora commented 9 years ago

No network drives. :(

On Thu, Jul 2, 2015 at 6:37 PM, Cecil Coupe notifications@github.com wrote:

Are there network drives involved?

— Reply to this email directly or view it on GitHub https://github.com/Shoes3/shoes3/issues/135#issuecomment-118202805.

aarmora commented 9 years ago

scraper_rb_location shoes_search

Here I've included a picture of a search for shoes. I've also included where I have been running the scraper.exe from. Scraper.rb is created in that path.

ccoupe commented 9 years ago

I'm running out of things to look for. That all looks reasonably normal although a bit heavy for a test system - still it ought to be OK. From the command, cd to where Scraper.rb is and run cshoes.exe Scraper.rb -- cshoes is a little better about sending output to the console than shoes.exe - maybe there will be a clue. - It could also trigger a font cache rebuild that can take a minute or two to finish before anything happens.

Another test that probably won't make a difference - Create a folder on the packaging machine 'scrapetest' or something and copy Scraper.rb into it. Then use Shoes to package that that 'scrapetest' directory - creates a.shy and then make an exe. Copy the exe to the test system, uninstall Shoes on the test system, reboot if you thnk it might help, then dblclick the scapetest.exe Shoes should be installed along with the font cache delay, and then it will expand scraptest.shy into C:\Users\Jordan\AppData\Local\shapetest - while Shoes is still open.

No need to thank me until we figure out what's gone wrong and we fix it.

ccoupe commented 9 years ago

One other thing. The search you did for 'Shoes' shows some icons that should be inside C;\Program File(x86)shoes\static but appear to be in C:\ - symptoms of previous failed install perhaps. Can you verify that those png are there? That would be bad news because there could be dll's in the wrong place.

ccoupe commented 9 years ago

@aarmora

I did think of something to do next. I've got a debug build of my isp.exe that you can download from http://walkabout.mvmanila.com/public/share/isp.exe and start from the command line as I do below:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\Cecil>isp.exe
payload C:\Users\Cecil\AppData\Local\Temp\isp.rb, len: 2080
cmd: C:\Program Files (x86)\Shoes\Shoes.exe
Return: 42

This prints out the full path to the script (payload) and Shoes (cmd) and then runs it. It's that payload line that causing your problem,I believe.

aarmora commented 9 years ago

Hey Cecil,

Sorry, kind of lost track of this over the holiday weekend. Doing some additional testing has lead me to believe that rb_sysopen is tied to my use of "File". Is it possible that Shoes doesn't have permission to open/create files? If so, how would I grant it permissions?

PS - Just saw that you emailed me. Haha, that's great!

Thanks,

Jordan

On Thu, Jul 2, 2015 at 8:06 PM, Cecil Coupe notifications@github.com wrote:

One other thing. The search you did for 'Shoes' shows some icons that should be inside C;\Program File(x86)shoes\static but appear to be in C:\ - symptoms of previous failed install perhaps. Can you verify that those png are there? That would be bad news because there could be dll's in the wrong place.

— Reply to this email directly or view it on GitHub https://github.com/Shoes3/shoes3/issues/135#issuecomment-118211029.

ccoupe commented 9 years ago

@aarmora - even better news! I've recreated your problem and it's mine to solve. That path to temp only works for me because I had an old file there. isp.rb or scraper.rb is not being copied to temp where it belongs.

aarmora commented 9 years ago

So is it tied to permissions, then? I suppose I could wait for your solution but I'm so curious!

On Mon, Jul 6, 2015 at 3:38 PM, Cecil Coupe notifications@github.com wrote:

@aarmora https://github.com/aarmora - even better news! I've recreated your problem and it's mine to solve. That path to temp only works for me because I had an old file there. isp.rb or scraper.rb is not being copied to temp where it belongs.

— Reply to this email directly or view it on GitHub https://github.com/Shoes3/shoes3/issues/135#issuecomment-119005021.

ccoupe commented 9 years ago

The suspect code is https://github.com/Shoes3/shoes3/blob/master/platform/msw/stub.c Permissions is not the problem. That code takes a fair amount of testing, but in a day or so I should have a Shoes beta 3.2.24 that should work for you.

ccoupe commented 9 years ago

I'll bet it works if you package scraper.rb as a .shy

aarmora commented 9 years ago

I actually tried that and it worked the first time (shoes was already installed). Then I tried to duplicate it by uninstalling all traces of shoes and ran the exe first (to install shoes) and then ran the shy and it gave the same error. I'll try some more variations, though, and try to replicate my first success.

On Mon, Jul 6, 2015 at 3:47 PM, Cecil Coupe notifications@github.com wrote:

I'll bet it works if you package scraper.rb as a .shy

— Reply to this email directly or view it on GitHub https://github.com/Shoes3/shoes3/issues/135#issuecomment-119006490.

ccoupe commented 9 years ago

Only if you nothing better to do. It's my problem to fix.

ccoupe commented 9 years ago

if you're feeling adventurous you can download http:///walkabout.mvmanila.com/public/share/shoes-stub.exe and copy it to C:\Program File (x86)\Shoes\static\stubs and replace the one there ON THE BUILD system. Repackage scaper.rb on that system and try scraper.exe on your test system (no need to uninstall Shoes on either for this test).

aarmora commented 9 years ago

Cecil you beautiful man! That totally did it.

Okay, now I have two other side questions. Maybe that is abusing your generosity because they aren't exactly bugs.

I'm creating a file with this app and the app saves it to the current directory. Ideally this would be the location of the executable but it looks like it's being run from %HOME%/AppData/Local/Temp and so it is saved there. Is there any way to force it to save to whatever directory the executable is located in?

The second thing is how can I display the "para" code as it's being run. I'm running a loop that could go for 40 minutes or so and I'd like the end user to be able to see the progress (and possibly close the program). I am using "para" in the app but it's not displayed to the user until the whole program completes. Is there a way to display it as it's being run?

Thanks so much! This really has been great code and besides that small bug, it was incredibly simple to implement.

Jordan

On Mon, Jul 6, 2015 at 5:13 PM, Cecil Coupe notifications@github.com wrote:

Closed #135 https://github.com/Shoes3/shoes3/issues/135 via 8f90963 https://github.com/Shoes3/shoes3/commit/8f90963a5bf83d8812408577f5767308421d3670 .

— Reply to this email directly or view it on GitHub https://github.com/Shoes3/shoes3/issues/135#event-349167732.

ccoupe commented 9 years ago

Good. Actually the problem was introduced when I "solved" issue #110 which is related to long running tasks and displaying progress messages. #issue 127 is to create a console that can be handle simple ruby puts for all flavours of Shoes. Until 127 is finished you're restricted to using the #110 method on Windows which requires you to package the script from the command line. Please see https://github.com/Shoes3/shoes3/wiki/Command-line-packager

You can use the existing Shoes 'info' or 'debug' commands to write progress message to the current Shoes console and they show up fairly quickly. You can bring that console to the front programmaticly with Shoes.show_log (or is it Shoes::show_log?). You can also study shoes/log.rb to get some ideas about what it's doing.

There is no good way to get the location of the launching exe. You may find suitable ruby ENV vars will get you close enough. Run samples/simple-info.rb to see them There are DIR and LIB_DIR constants that Shoes sets but they probably won't help here.

A more general solution is awaiting the long delayed 'secondary' installer. See http://walkabout.mvmanila.com/2014/12/05/default-custom-app-installer/

The short answer is to ask the user where to put the file you create.

aarmora commented 9 years ago

Cecil,

Thanks for the response. I'll use those suggestions. You have a great project here.

Thanks,

Jordan

On Mon, Jul 6, 2015 at 7:16 PM, Cecil Coupe notifications@github.com wrote:

Good. Actually the problem was introduced when I "solved" issue #110 https://github.com/Shoes3/shoes3/issues/110 which is related to long running tasks and displaying progress messages. #issue 127 is to create a console that can be handle simple ruby puts for all flavours of Shoes. Until 127 is finished you're restricted to using the #110 https://github.com/Shoes3/shoes3/issues/110 method on Windows which requires you to package the script from the command line. Please see https://github.com/Shoes3/shoes3/wiki/Command-line-packager

You can use the existing Shoes 'info' or 'debug' commands to write progress message to the current Shoes console and they show up fairly quickly. You can bring that console to the front programmaticly with Shoes.show_log (or is it Shoes::show_log?). You can also study shoes/log.rb to get some ideas about what it's doing.

There is no good way to get the location of the launching exe. You may find suitable ruby ENV vars will get you close enough. Run samples/simple-info.rb to see them There are DIR and LIB_DIR constants that Shoes sets but they probably won't help here.

A more general solution is awaiting the long delayed 'secondary' installer. See http://walkabout.mvmanila.com/2014/12/05/default-custom-app-installer/

The short answer is to ask the user where to put the file you create.

— Reply to this email directly or view it on GitHub https://github.com/Shoes3/shoes3/issues/135#issuecomment-119040345.

shaoyumiao commented 9 years ago

Same issue occurs.It works by following steps,Thanks for Cecil

if you're feeling adventurous you can download http:///walkabout.mvmanila.com/public/share/shoes-stub.exe and copy it to C:\Program File (x86)\Shoes\static\stubs and replace the one there ON THE BUILD system. Repackage scaper.rb on that system and try scraper.exe on your test system (no need to uninstall Shoes on either for this test).

brianunlam commented 9 years ago

ey man!, thanks, replacing the shoes-stub.exe solves the problem!

arka6 commented 7 years ago

I'm having this same problem back in windows 10 with latest shoes (walkabout 3.3.2), tried to replace the shoes-stub.exe with no luck.

ccoupe commented 7 years ago

@arka6 Shoes 3.3.2 has the updated stub.exe. Shoes packaging for Windows 10 is mostly broken. Win 10 thinks the packaged exe is a virus and only code signing will convince Win 10 to run it. I did once turn off some magic setting but I forgot what it was and your end users shouldn't do that, either. There is a complicated way to build Win 10 apps.