Skip to content
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

BoundsError: attempt to access 0-element Vector{String} at index [1] #7

Open
mchitre opened this issue Jul 12, 2024 · 0 comments
Open

Comments

@mchitre
Copy link

mchitre commented Jul 12, 2024

A simple script yyy.jl that just prints fails using juliascript:

~> cat yyy.jl
println("xxx")

~> julia yyy.jl
xxx

~> juliascript yyy.jl
ERROR: BoundsError: attempt to access 0-element Vector{String} at index [1]
Stacktrace:
 [1] getindex
   @ ./essentials.jl:13 [inlined]
 [2] prefix_lines(prefix::String, script_content::String; skip_first::Bool)
   @ JuliaScript.Helpers ~/.julia/packages/JuliaScript/KBGYf/src/Helpers.jl:106
 [3] prefix_lines
   @ ~/.julia/packages/JuliaScript/KBGYf/src/Helpers.jl:102 [inlined]
 [4] create_script_package(; script_path::String, script_content::String, cache_name::String, cache_path::String, rest::@Kwargs{})
   @ JuliaScript ~/.julia/packages/JuliaScript/KBGYf/src/JuliaScript.jl:92
 [5] create_script_package
   @ ~/.julia/packages/JuliaScript/KBGYf/src/JuliaScript.jl:76 [inlined]
 [6] run_script(script_path::String, commandline_args::Vector{String})
   @ JuliaScript ~/.julia/packages/JuliaScript/KBGYf/src/JuliaScript.jl:57
 [7] julia_main()
   @ JuliaScript ~/.julia/packages/JuliaScript/KBGYf/src/JuliaScript.jl:37
 [8] top-level scope
   @ none:1

Other issues in getting started

It might be worthwhile to improve documentation to help with the following issues I faced in getting started:

  1. I am on a MAC OS X. It didn't have sha256sum, which had to be installed. The documentation perhaps needs information on this. Also the installation instruction about downloading didn't work for me, as the juliaup installation directory assumption is not valid on all systems.
  2. It is unclear as to how a script is supposed to depend on packages, if it needs more than a standard library.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant