Closed notmaxx closed 5 years ago
I have the same issue with a strange "workaround". In IRB:
2.3.3 :001 > require "wasmer"
=> true
2.3.3 :002 > Wasmer::Instance
NameError: uninitialized constant Wasmer::Instance
Did you mean? Instance
...
2.3.3 :003 > Instance
=> Instance
Might be an issue with Rutie with Ruby 2.3.3.
The same issue with MRI 2.6.1
2.6.1 :004 > require "wasmer"
=> true
2.6.1 :005 > Wasmer::Instance
Traceback (most recent call last):
16: from /Users/tikh/.rvm/gems/ruby-2.6.1/gems/bundler-2.0.2/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors'
15: from /Users/tikh/.rvm/gems/ruby-2.6.1/gems/bundler-2.0.2/exe/bundle:30:in `block in <top (required)>'
14: from /Users/tikh/.rvm/gems/ruby-2.6.1/gems/bundler-2.0.2/lib/bundler/cli.rb:18:in `start'
13: from /Users/tikh/.rvm/gems/ruby-2.6.1/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
12: from /Users/tikh/.rvm/gems/ruby-2.6.1/gems/bundler-2.0.2/lib/bundler/cli.rb:27:in `dispatch'
11: from /Users/tikh/.rvm/gems/ruby-2.6.1/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
10: from /Users/tikh/.rvm/gems/ruby-2.6.1/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
9: from /Users/tikh/.rvm/gems/ruby-2.6.1/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
8: from /Users/tikh/.rvm/gems/ruby-2.6.1/gems/bundler-2.0.2/lib/bundler/cli.rb:465:in `exec'
7: from /Users/tikh/.rvm/gems/ruby-2.6.1/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:28:in `run'
6: from /Users/tikh/.rvm/gems/ruby-2.6.1/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:74:in `kernel_load'
5: from /Users/tikh/.rvm/gems/ruby-2.6.1/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:74:in `load'
4: from /Users/tikh/.rvm/rubies/ruby-2.6.1/bin/irb:23:in `<top (required)>'
3: from /Users/tikh/.rvm/rubies/ruby-2.6.1/bin/irb:23:in `load'
2: from /Users/tikh/.rvm/rubies/ruby-2.6.1/lib/ruby/gems/2.6.0/gems/irb-1.0.0/exe/irb:11:in `<top (required)>'
1: from (irb):5
NameError (uninitialized constant Wasmer::Instance)
2.6.1 :006 > Instance
=> Instance
Same thing here: ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux] rustc 1.35.0 (3c235d560 2019-05-20)
I did install the gem with the --verbose option and the only thing I noticed was the following fatal error messages below that most likely comes from a git command being executed from the gem file. It doesn't stop the installation though.
Building native extensions. This could take a while...
current directory: /home/ljulliard/.rvm/gems/ruby-2.6.3/gems/wasmer-0.2.0
["/home/ljulliard/.rvm/rubies/ruby-2.6.3/bin/ruby", "-rrubygems", "/home/ljulliard/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/exe/rake", "RUBYARCHDIR=/home/ljulliard/.rvm/gems/ruby-2.6.3/extensions/x86_64-linux/2.6.0/wasmer-0.2.0", "RUBYLIBDIR=/home/ljulliard/.rvm/gems/ruby-2.6.3/extensions/x86_64-linux/2.6.0/wasmer-0.2.0"]
**fatal: not a git repository (or any of the parent directories): .git**
bundle install
**fatal: not a git repository (or any of the parent directories): .git**
Fetching gem metadata from https://rubygems.org/.............
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Using rake 10.5.0
....
Does this ring a bell for anyone ?
Did you try with Ruby 2.6? This is the version I use and the version that is tested on the CI.
$ ruby examples/simple.rb
3
$ ruby --version
ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-darwin18]
I'm surprised @ljulliar experiences a similar issue with the same version than I have :-/.
I use Rutie 0.6.1 on Rust, and 0.0.3 on Ruby.
I do confirm I see the exact same problem on 2.6.3. I am too using rutie 0.6.1 on rust side BUT rust 0.0.4 on Ruby side and not 0.0.3 as you. Have you tried with 0.0.4 ?
I didn't. Can you try with Rutie 0.0.3 on Ruby side please?
I downgraded to rust 0.0.3 on the Ruby side and still the same problem. @tikh @notmaxx are you also running Linux ? (I am on Debian 10)
Well actually while running
gem install --verbose wasmer
I noticed that the rutie crane installed is actually version 0.5.4, not 0.6.1 and I'm not quite sure how to force the installation of 0.6.1
cargo build --release
Compiling proc-macro2 v0.4.27
Compiling unicode-xid v0.1.0
Compiling ryu v0.2.7
Compiling syn v0.15.31
Compiling serde v1.0.90
Compiling libc v0.2.51
Compiling cc v1.0.35
Compiling autocfg v0.1.2
Compiling failure_derive v0.1.5
Compiling semver-parser v0.7.0
Compiling itoa v0.4.3
Compiling rand_core v0.4.0
Compiling byteorder v1.3.1
Compiling arrayvec v0.4.10
....
Compiling rutie v0.5.4
....
Weird. Try running cargo update
.
So I cd into the gem build directory and did a cargo update. A number of crates were updated included rutie BUT it went from 0.5.4 to 0.5.6
log messages: $ cargo update .....snip, snip Updating rutie v0.5.4 -> v0.5.6 .....snip, snip
So then I looked into the cargo.toml file and noticed that on line 20 it says:
rutie = "0.5.4"
where as the latest version on github says
rutie = "0.6.0"
So what I suspect is that the wasmer gem on rubygem.org ( https://rubygems.org/gems/wasmer - version 0.2.0 from May 1, 2019) is either outdated or wasn't generated with the proper Cargo.toml.
May be the best thing to do would be to publish an updated version on rubygems.org as this is the one source of truth for rubygems. @Hywan : what do you think?
On Mon, Aug 19, 2019 at 11:07 AM Ivan Enderlin notifications@github.com wrote:
Weird. Try running cargo update.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/wasmerio/ruby-ext-wasm/issues/21?email_source=notifications&email_token=AAAED4JSN5DHOT77XFSSM5TQFJPETA5CNFSM4IJGNTN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4SHAOI#issuecomment-522481721, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAED4JX5WZ3QFFDEPYW3ADQFJPETANCNFSM4IJGNTNQ .
I think I've to update the gems, yes.
I just forgot to publish the gems… Sorry for that, it may be the issue!
Done, https://rubygems.org/gems/wasmer. Does it help?
@Hywan : It works just fine now. Thank you!
Glad to hear that! I'm closing the issue. If someone else still experiences an installation issue, please ping me, I'll reopen.
Thanks everyone, and sorry for the rubygem oversight!
Describe the bug
Example applications do not work
Steps to reproduce
install rust, install wasmer gem, clone repo and run example applications
Expected behavior
Examples should work
Actual behavior
Rutie
is able to open libraryAdditional context