Very sorry to bother you
icaiyu opened this issue · 9 comments
Hello, I am a new user of the embulk. And when I using your plugin and want to run the the test.
It told me that Embulk.setup works only with JRuby(RuntimeError)
But I have already set the ruby version to the jruby-9.1.12.0 using the rbenv.
Really sorry to bother you with this issue.
@icaiyu Hi. Could you show us following informations?
- What do you want to do ?
- Do you want install embulk-output-bigquery plugin or want to run its unit test?
- What did you tried?
- Could you show us command history and stacktrace
- What "Embulk.setup" means?
- I want to run its unit test
- when I run the 'bundle exec rake test'
/usr/local/bin/ruby -I"lib:test" -I"/home/cy/embulk-output-bigquery/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib" "/home/cy/embulk-output-bigquery/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib/rake/rake_test_loader.rb" "test/test_bigquery_client.rb" "test/test_configure.rb" "test/test_example.rb" "test/test_file_writer.rb" "test/test_helper.rb" "test/test_transaction.rb" "test/test_value_converter_factory.rb"
/home/cy/embulk-output-bigquery/vendor/bundle/ruby/2.2.0/gems/embulk-0.8.26/lib/embulk.rb:42:in `setup': Embulk.setup works only with JRuby. (RuntimeError)
from /home/cy/embulk-output-bigquery/test/helper.rb:8:in `<top (required)>'
from /home/cy/embulk-output-bigquery/test/test_bigquery_client.rb:1:in `require_relative'
from /home/cy/embulk-output-bigquery/test/test_bigquery_client.rb:1:in `<top (required)>'
from /home/cy/embulk-output-bigquery/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib/rake/rake_test_loader.rb:15:in `require'
from /home/cy/embulk-output-bigquery/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib/rake/rake_test_loader.rb:15:in `block in <main>'
from /home/cy/embulk-output-bigquery/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib/rake/rake_test_loader.rb:4:in `select'
from /home/cy/embulk-output-bigquery/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib/rake/rake_test_loader.rb:4:in `<main>'
rake aborted!
Command failed with status (1): [ruby -I"lib:test" -I"/home/cy/embulk-output-bigquery/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib" "/home/cy/embulk-output-bigquery/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib/rake/rake_test_loader.rb" "test/test_bigquery_client.rb" "test/test_configure.rb" "test/test_example.rb" "test/test_file_writer.rb" "test/test_helper.rb" "test/test_transaction.rb" "test/test_value_converter_factory.rb" ]
/home/cy/embulk-output-bigquery/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
/usr/local/bin/bundle:23:in `load'
/usr/local/bin/bundle:23:in `<main>'
Tasks: TOP => test
(See full trace by running task with --trace)
Could you show me following command result?
$ cd /home/cy/embulk-output-bigquery/
$ ruby -v
My result
jruby 9.0.5.0 (2.2.3) 2016-01-26 7bee00d Java HotSpot(TM) 64-Bit Server VM 25.101-b13 on 1.8.0_101-b13 +jit [darwin-x86_64]
root@cy:/home/cy/embulk-output-bigquery# ruby -v
jruby 9.1.12.0 (2.3.3) 2017-06-15 33c6439 Java HotSpot(TM) 64-Bit Server VM 25.131-b11 on 1.8.0_131-b11 +jit [linux-x86_64]
I checked your log again and it seems JRuby9.1.12.0 is not used when you run test.
$ bundle exec rake test
/Users/akama/.rbenv/versions/jruby-9.0.5.0/bin/jruby -I"lib:test" -I"/Users/akama/data/embulk-output-bigquery/vendor/bundle/jruby/2.2.0/gems/rake-11.2.2/lib" "/Users/akama/data/embulk-output-bigquery/vendor/bundle/jruby/2.2.0/gems/rake-11.2.2/lib/rake/rake_test_loader.rb" "test/test_bigquery_client.rb" "test/test_configure.rb" "test/test_example.rb" "test/test_file_writer.rb" "test/test_helper.rb" "test/test_transaction.rb" "test/test_value_converter_factory.rb"
/Users/akama/data/embulk-output-bigquery/vendor/bundle/jruby/2.2.0/gems/power_assert-0.3.0/lib/power_assert.rb:7: warning: tracing (e.g. set_trace_func) will not capture all events without --debug flag
/Users/akama/data/embulk-output-bigquery/vendor/bundle/jruby/2.2.0/gems/power_assert-0.3.0/lib/power_assert.rb:7: warning: tracing (e.g. set_trace_func) will not capture all events without --debug flag
/Users/akama/data/embulk-output-bigquery/example/your-project-000.json is not found. Skip test/test_bigquery_client.rb
/Users/akama/data/embulk-output-bigquery/example/your-project-000.json is not found. Skip test/test_example.rb
Loaded suite <script>
Started
...............................................................................
Finished in 1.11 seconds.
--------------------------------------------------------------------------------------------------------------------------------
79 tests, 195 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
--------------------------------------------------------------------------------------------------------------------------------
71.17 tests/s, 175.68 assertions/s
Yes. As you see, my ruby version is jruby-9.1.12.0. but why it is not used when I run the test? is there any configuration about the ruby executable in the embulk-output-bigquery file?
I just configure /path/to/embulk-output-bigquery/.ruby-version
.
$ cd /path/to/embulk-output-bigquery
$ vi .ruby-version
jruby-9.0.5.0
$ cd ../
cd embulk-output-bigquery
$ ruby -v
jruby 9.0.5.0 (2.2.3) 2016-01-26 7bee00d Java HotSpot(TM) 64-Bit Server VM 25.101-b13 on 1.8.0_101-b13 +jit [darwin-x86_64]
But your ruby -v
shows jruby 9.1.12.0...
and I don't know why bundle exec rake test
failed.
Thank you for your tip and I doubt that it may be the problem about the rbenv. I sovled it by using the command 'rbenv rehash' and now the test using the jruby. Anyway, you are very kind and patient. Thanks.
rbenv rehash
. Ah, make sense.