-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ocra 1.2.0 fails to load 'prawn' gem #24
Comments
Could you try with 1.3.0-rc1 for me? (gem install ocra --pre) Thanks! |
I have loaded 1.3.0-rc1 and used the following script to test the loading of prawn: code: require 'prawn' puts "Hello World" end of code: the executable gave an error message: 'require': no such file to load -- prawn (LoadError) I believe I know the reason for the failure. Prawn's gemspec is incomplete .. it does not have a "s.file" array containing the list of files to load. I was about to test my theory to prove to myself if am correct. I will let know the result. By the way, 'prawn' has 3 dependencies: Ascii85, pdf-reader, and ttfunk. |
On Apr 20, 2011, at 9:47 AM, larsch wrote:
I have loaded 1.3.0-rc1 and used the following script to test the loading of prawn: code: require 'prawn' puts "Hello World" end of code: the executable gave an error message: 'require': no such file to load -- prawn (LoadError) I believe I know the reason for the failure. Prawn's gemspec is incomplete .. it does not have a "s.file" array containing the list of files to load. I was about to test my theory to prove to myself if am correct. I will let know the result. By the way, 'prawn' has 3 dependencies: Ascii85, pdf-reader, and ttfunk. Perhaps you could contact the developers about the deficiencies in the gemspec. You carry more weight than I. Thank you for looking into this problem. Bernard Kenik PS I tried to reply on github and accidentally closed the issue. |
I am unable to reproduce the problem on my system. I have ruby-1.9.2-p180, ocra-1.3.0-rc1, prawn-0.11.1 installed via "gem install prawn". I'm not sure what caused the gemspec problem on your system. |
Just updated rubygems to 1.7.2 and reinstalled prawn; that broke it for me too. I've posted a bug on Rubygems. I've also pushed a change to Ocra that allows you to do this: ocra prawn_sample.rb c:/appl/rubyinstaller-1.9.2-p180/lib/ruby/gems/1.9.1/gems/prawn-0.11.1/{data,lib}/**/* |
On Apr 23, 2011, at 7:39 AM, larsch wrote:
Thank you for working a solution! Now for the GOOD and BAD news!!!!! Good news I installed the latest version of ocra. (gem install ocra --pre, gem 1.7.2) I build my application -- I had to use the added phrase for both prawn and ttfunk gems since they both have a data directory. A quick study of the verbose output revealed that all expected files were loaded including the data. BAD news I received the load error message: no such file to load -- prawn (LoadError) I tried 2 more times with and without "require 'rubygems' " ... same result I have then build for the 2-line program < require prawn"; puts "Hello World" > I am the only user ... thus the system user never had that error message before The one thing that concern me is the location -- abput 5 levels up from the src directory Please let me what else I can and should to help you solve this problem. |
On Apr 23, 2011, at 7:39 AM, larsch wrote:
I tried the following experiment to find out the possible cause your suggestion to fails to solve the problem. Gem Ascii85 is one of Prawn's dependencies. I wrote 2 short scripts to build an exe that requires the Ascii85-1.0.0 gem. Actually they are both identical. I subsequently I appended the log file. The first script is built as follows: and the second script: The first invocation allows the exe to succeed while the second invocation results in the exe to generate a FATAL ERROR. I ran the log files through a file comparator the following shown below were the only differences found. Perhaps if the gems were not listed as "user-supplied sources files" then ocra could build a successful exe. === Adding user-supplied source files first invocation === Adding user-supplied source files second invocation |
I did not yet release the changed I made to ocra which fixed the ../../..-problem, but they are on github. |
On Apr 26, 2011, at 4:25 AM, larsch wrote:
I just downloaded the latest ocra (gem install ocra --pre) which I assume is the fixed ocra version above. A very quick test reveals that the prawn gem can be "require"ed within the test.exe. I need to further check wether the Will let you know as soon as I have completed the test. Thank You Bernard Kenik |
On Apr 26, 2011, at 4:25 AM, larsch wrote:
This is a follow up to this morning e-mail. I am to sure if I do have the ocra from github -- do not know how to do it. ran my test script as follows: ocra --verbose test.rb c:/ruby192/lib/ruby/gems/1.9.1/gems/prawn-0.11.1/{data,lib}/*/ > test2.log no error messages during the building when I "compile" the test.rb a: ocra --verbose test.rb > test.log so my conclusion is that I may be not using the ocra from GitHud build my scrip without any error messages when I run my script using ruby , it runs without any error message and produces 5 expected pdf files correctly. when I run the exe it produces the expected 5 expected pdf files correctly. However, the following set of error messages occur when producing a pdf file: C:/DOCUME need further investigation on my part. |
Larsch Sorry that it took a while to get back to you. I have coded and tested several methods and integrated them in Ocra module. Overview: The methods replace the s.files entries with a list of gem files that are requested...but only from the bin, lib, and data directories and their sub directories. The file lists are obtained by scanning the directories. In this manner, ocra no longer needs to rely on the gem author to place the information in the s.files entry of the gemspec. This is done just before ocra reads the s.files entry. The gathering of the list only needs to done once. Once the list has been generated, a "flag" file is placed in the gem's root directory. The flag remains until it is either manually deleted or the gem is uninstalled and a new version installed. The time ocra processes the gem the files list will be obtained and placed in gem's root directory.This minimizes the interference the methods may impose. Actually the gathering of the lists is just one line of code to scan an entire directory tree. I have tested the methods on Windows XP SP3, ruby-1.9.2, ocra-1.3.1-rc1. I used Ascii85, ttfunk, pdf-reader, and prawn gems to test the methods as I developed them. The smoke test was the successful compilation of my script. Let's say that I triumphed. Integration occurs at only one point in ora's code. Extremely easy to undo. Ocra behaves exactly as it originally did. I hope that you accept and use my contribution to ocra. You done an excellent job, especially since you wrote it in Ruby. I have enclosed my version of ocra. The methods are:
Each methods have a brief description of their functions. The point of integration is: the first line in " gems.each do | gempath, fullgemname | " line 603 in my code listing. I told you a lie when I said that my script ran without a small hiccup. Prawn issued info messages concerning not having loaded an encoding .... TTF-16BE to be precise. The script continued to completion and all outputs were produced correctly. After some digging and thinking I determined that prawn required some encoding resource located from one of the built-in module ... aptly named "encoding." The solution is easy but very expensive!!! I use the '--load-all-core' option. A lot of code to shut down info message caused by 2 lines of code. Would it be possible to load only one built-in module as opposed to the entire set of modules? Thank You |
Larsch I have implemented the solution. I have added two options. I believe that the above would resolve some of the problems experienced by users. I am not that familiar with github -- so what would be the best for me to send my version of ocra executable file? |
See also issue #26 with a patch which should solve this problem. |
1.3.0 released, closing issue. |
Env: Window XP SP3, ruby 1.9.2 installed using rubyinstaller
Package a script which required the 'rake' gem. Ocra ran fine with no error message. When I tried to invoke the executable I received the following message:
C:/DOCUME
1/Owner/LOCALS1/Temp/ocr28.tmp/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36: in 'require' no such file to load --- prawn (LoadError) .from C:/DOCUME~/owner/LOCALS~//Temp/ocr28.tmp/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
''require' rom C:/DOCUME~/owner/LOCALS~//Temp/ocr28.tmp/src/df_dda.rb:22:in
Examination of ocra's output reveals that only the following lines contained "prawn"
a lib/ruby/gems/1.9.1/specifications/prawn-0.11.1.gemspec --- appears twice
m lib/ruby/gems/1.9.1/prawn-0.11.1/
a lib/ruby/gems/1.9.1/prawn-0.11.1/COPYING
a lib/ruby/gems/1.9.1/prawn-0.11.1/HACKING
a lib/ruby/gems/1.9.1/prawn-0.11.1/LICENSE
a lib/ruby/gems/1.9.1/prawn-0.11.1/README
no listing of rb files for the prawn gem.
Use the following program which replicates the problem.
require 'prawn'
puts "Hello world"
the specifications list pdf_reader-0.9.1.gemspec, Ascii85-1.0.0.gemspec, and ttfunk-1.0.1.gemspec as prawn dependencies.
Only pdf_reader rb files are listed in ocra's output.
Assistance in solving this problem is appreciated.
Thank you
Bernard Kenik
The text was updated successfully, but these errors were encountered: