ArgumentError: cannot interpret as DNS name: nil capybara - ruby-on-rails

Hi all can anyone help me to resolve the issue
'ArgumentError: cannot interpret as DNS name: nil'
The error is coming when doing capybara selenium integration testing in rails 4
here I am using jruby-1.7.9 and ruby version inside JRuby is 2.0.0p195
already I had used the Ruby version is 1.9.7 at that time I faced the error
'cant connect to chrome driver error'
in pure ruby like without using JRuby its the integration testing is working. but my application is in JRuby. and I am using ubuntu platform.
So anyone have any solution on this. what should I do to resolve this??
Here iam adding the exception backtrace
["/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/2.0/resolv.rb:1181:in create'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/2.0/resolv.rb:1027:ingenerate_candidates'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/2.0/resolv.rb:1052:in resolv'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/2.0/resolv.rb:518:ineach_resource'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/2.0/resolv.rb:411:in each_address'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/2.0/resolv.rb:120:ineach_address'", "org/jruby/RubyArray.java:1613:in each'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/2.0/resolv.rb:119:ineach_address'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/2.0/resolv.rb:97:in getaddress'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/2.0/resolv.rb:48:ingetaddress'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/1.9/resolv-replace.rb:10:in getaddress'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/1.9/resolv-replace.rb:22:ininitialize'", "org/jruby/RubyIO.java:1178:in open'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/2.0/net/http.rb:882:inconnect'", "org/jruby/ext/timeout/Timeout.java:144:in timeout'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/2.0/net/http.rb:881:inconnect'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/2.0/net/http.rb:866:in do_start'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/2.0/net/http.rb:855:instart'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/2.0/net/http.rb:582:in start'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/capybara-2.9.1/lib/capybara/server.rb:81:inresponsive?'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/capybara-2.9.1/lib/capybara/server.rb:97:in boot'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/capybara-2.9.1/lib/capybara/session.rb:72:ininitialize'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/capybara-2.9.1/lib/capybara.rb:324:in current_session'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/capybara-2.9.1/lib/capybara/dsl.rb:47:inpage'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/capybara-2.9.1/lib/capybara/dsl.rb:52:in visit'", "/media/sidharthan/NewVolume/sidharthan_fooddev/foodapp/webapp/food/test/test_helper.rb:115:inIntegrationTest'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/capybara-2.9.1/lib/capybara.rb:67:in configure'", "/media/sidharthan/NewVolume/sidharthan_fooddev/foodapp/webapp/food/test/test_helper.rb:102:inIntegrationTest'", "org/jruby/RubyBasicObject.java:1565:in instance_exec'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:446:inmake_lambda'", "org/jruby/RubyProc.java:271:in call'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:192:insimple'", "org/jruby/RubyProc.java:271:in call'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:504:incall'", "org/jruby/RubyArray.java:1613:in each'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:504:incall'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:92:in __run_callbacks__'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:782:in_run_setup_callbacks'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:81:in run_callbacks'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/activesupport-4.2.6/lib/active_support/testing/setup_and_teardown.rb:41:inbefore_setup'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/activerecord-4.2.6/lib/active_record/fixtures.rb:827:in before_setup'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/minitest-5.9.1/lib/minitest/test.rb:105:inrun'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/minitest-5.9.1/lib/minitest/test.rb:204:in capture_exceptions'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/minitest-5.9.1/lib/minitest/test.rb:104:inrun'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/minitest-5.9.1/lib/minitest/test.rb:255:in time_it'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/minitest-5.9.1/lib/minitest/test.rb:103:inrun'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/minitest-5.9.1/lib/minitest.rb:348:in on_signal'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/minitest-5.9.1/lib/minitest/test.rb:275:inwith_info_handler'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/minitest-5.9.1/lib/minitest/test.rb:102:in run'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/minitest-5.9.1/lib/minitest.rb:799:inrun_one_method'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/minitest-5.9.1/lib/minitest.rb:322:in run_one_method'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/minitest-5.9.1/lib/minitest.rb:310:inrun'", "org/jruby/RubyArray.java:1613:in each'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/minitest-5.9.1/lib/minitest.rb:309:inrun'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/minitest-5.9.1/lib/minitest.rb:348:in on_signal'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/minitest-5.9.1/lib/minitest.rb:335:inwith_info_handler'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/minitest-5.9.1/lib/minitest.rb:308:in run'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/minitest-5.9.1/lib/minitest.rb:158:in__run'", "org/jruby/RubyArray.java:2409:in map'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/minitest-5.9.1/lib/minitest.rb:158:in__run'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/minitest-5.9.1/lib/minitest.rb:135:in run'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/minitest-5.9.1/lib/minitest.rb:62:inautorun'"]
Thanks in advance

From the stacktrace you can see it's erring inside https://github.com/teamcapybara/capybara/blob/2.9.1/lib/capybara/server.rb#L81 - which is while Capybara is waiting for the application to be tested to start up.
This could mean you have set Capybara.server_host or Capybara.server_port incorrectly. Without the real code you're running that generates the stacktrace it's impossible to say.
You also probably want to update to the latest 2.x version of Capybara -- 2.9.1 is really old.

Related

Neo4j.rb (8.0.11) + Resque : Input/output error # io_write - <STDOUT>

I have recently upgraded neo4j and I am getting issue in resque workers,
Exception
Errno::EIO
Error
Input/output error # io_write - <STDOUT>
I am getting this issue and backtrace says its related to neo4j.rb puts
Errno::EIO: Input/output error - <STDOUT>
/home/ubuntu/staycircles-backend/shared/bundle/ruby/2.3.0/gems/neo4j-8.0.11/lib/neo4j/session_manager.rb:60:in `write'
/home/ubuntu/staycircles-backend/shared/bundle/ruby/2.3.0/gems/neo4j-8.0.11/lib/neo4j/session_manager.rb:60:in `puts'
/home/ubuntu/staycircles-backend/shared/bundle/ruby/2.3.0/gems/neo4j-8.0.11/lib/neo4j/session_manager.rb:60:in `puts'
/home/ubuntu/staycircles-backend/shared/bundle/ruby/2.3.0/gems/neo4j-8.0.11/lib/neo4j/session_manager.rb:60:in `block in wait_for_value'
My current configration is
neo4j version - 3.xx
neo4j.rb - 8.0.11
Could you try updating to 8.0.13 of the neo4j gem?
The gem maintainers have released v 8.0.13, which removes the puts statements. Want to see if it fixes the issue on your end?
https://github.com/neo4jrb/neo4j/releases/tag/v8.0.13

NoMethodError: undefined method `bindings' for java.lang.NullPointerException

we're working on a ruby on rails (4.2.8) application which is running on jruby-1.7.25. It really is time to update this mummy to the latest version 9.1.7.0. We did that and for most of my colleagues it works out fine. But - guess what - not for me. Before posting my question here, I made sure that:
I have the same setup
Same DB content
The exactly same code
as the others, but I still get that stupid error which is
java.lang.NullPointerException and that's really all, the app is spitting out on any request.
I was digging for the last hours and found out, that the real issue is getting lost in the depth of logging. Finally I found, that I will see the real cause if I add a puts in the file vendor/jruby/2.3.0/gems/actionpack-4.2.8/lib/action_dispatch/middleware/show_exceptions.rb like:
class ShowExceptions
FAILSAFE_RESPONSE = [500, { 'Content-Type' => 'text/plain' },
["500 Internal Server Error\n" \
"If you are the administrator of this website, then please read this web " \
"application's log file and/or the web server's log file to find out what " \
"went wrong."]]
def initialize(app, exceptions_app)
#app = app
#exceptions_app = exceptions_app
end
def call(env)
#app.call(env)
rescue Exception => exception
puts "EXCEPTION: #{exception.inspect}\n#app: #{#app.inspect}\nENV: #{env.inspect}"
if env['action_dispatch.show_exceptions'] == false
raise exception
else
render_exception(env, exception)
end
end
The output is:
EXCEPTION: #<NoMethodError: undefined method `bindings' for java.lang.NullPointerException:Java::JavaLang::NullPointerException
#app and env print out kilobytes of data which probably do not help. Honestly, I'm kind of stuck here. How can it work on other machines while it fails on mine? Has anyone of you had a similar issue or any idea what causes this trouble?
Ah, some version infos
Puma: * Version 3.7.1 (jruby 9.1.7.0 - ruby 2.3.1), codename: Snowy Sagebrush
jruby: jruby 9.1.7.0 (2.3.1) 2017-01-11 68056ae Java HotSpot(TM) 64-Bit Server VM 24.79-b02 on 1.7.0_79-b15 +jit [darwin-x86_64]
java: java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)
Mac OSX: 10.12.3 (16D32)
Thanks for any hints!

Moped::Errors::OperationFailure failed with error "no such cmd

I recently upgraded from mongoid 2.0.2 to mongoid 3 with rails 3.2.12 and ruby 1.9.3 .
Following issue comes when save command excutes => #new_node.save
Moped::Errors::OperationFailure (The operation: #<Moped::Protocol::Command
#length=366
#request_id=30
#response_to=0
#op_code=2004
#flags=[:slave_ok]
#full_collection_name="campus_dev.$cmd"
#skip=0
#limit=-1
#selector={:aggregate=>"nodes", :pipeline=>[{"$match"=>{"parent_id"=>"51382df8851d1912b7000009", "_id"=>{"$ne"=>"513f24952f1feda4bc000002"}, "position"=>{"$nin"=>[nil]}}}, {"$group"=>{"_id"=>"position", "count"=>{"$sum"=>1}, "max"=>{"$max"=>"$position"}, "min"=>{"$min"=>"$position"}, "sum"=>{"$sum"=>"$position"}, "avg"=>{"$avg"=>"$position"}}}]}
#fields=nil>
failed with error "no such cmd"):
app/controllers/nodes_controller.rb:37:in `create'
You didn't mention also upgrading MongoDB version to the latest (at that time).
If you were pointing at an older MongoDB server that didn't recognize the "aggregate" command, then you would get exactly this error.
All instances of similar errors seem to have been pointing at older mongod process.

Aptana "Content Assist" did not complete normally

I have a problem with the Aptana Studio 3.
It is a fresh installation. I have imported a Ruby on Rails - project that a edited with a texteditor before. I want to use Aptana, for a more comfortable development but the Content Assist fails.
If I try to use the Content Assist it throws the following exception and write it to the Console:
[2013-03-08 16:34:40] An error occurred while processing the invoke block for the command ERb Content Assist in C:\Users\Chris\Aptana Rubles\rails.ruble\commands\content_assist.rb: (NoMethodError) undefined method `getInstance' for Java::ComAptanaIndexCore::IndexManager:Class
org.jruby.exceptions.RaiseException: (NoMethodError) undefined method `getInstance' for Java::ComAptanaIndexCore::IndexManager:Class
at Rails::ContentAssistant.index_manager(C:/Users/Chris/Aptana Rubles/rails.ruble/lib/content_assistant.rb:87)
at Rails::ContentAssistant.gem_indices(C:/Users/Chris/Aptana Rubles/rails.ruble/lib/content_assistant.rb:79)
at org.jruby.RubyProc.call(org/jruby/RubyProc.java:274)
at org.jruby.RubyProc.call(org/jruby/RubyProc.java:229)
at Java::JavaUtil::Collection.each(C:/Users/Chris/AppData/Local/Aptana Studio 3/plugins/org.jruby_1.6.4.1331328108/lib/ruby/site_ruby/shared/builtin/java/java.util.rb:7)
at org.jruby.RubyEnumerable.collect(org/jruby/RubyEnumerable.java:706)
at Rails::ContentAssistant.gem_indices(C:/Users/Chris/Aptana Rubles/rails.ruble/lib/content_assistant.rb:79)
at Rails::ContentAssistant.gem_and_project_indices(C:/Users/Chris/Aptana Rubles/rails.ruble/lib/content_assistant.rb:74)
at Rails::ContentAssistant.assist(C:/Users/Chris/Aptana Rubles/rails.ruble/lib/content_assistant.rb:31)
at #<Class:0x101f95cf6>.define_content_assist(C:\Users\Chris\Aptana Rubles\rails.ruble\commands\content_assist.rb:7)
at org.jruby.RubyProc.call(org/jruby/RubyProc.java:274)
at org.jruby.RubyProc.call(org/jruby/RubyProc.java:233)
The Aptana Log File contains this message:
!ENTRY org.eclipse.ui 4 4 2013-03-08 16:34:40.465
!MESSAGE "Content Assist" did not complete normally. Please see the log for more information.
!ENTRY org.eclipse.ui 4 0 2013-03-08 16:34:40.465
!MESSAGE (Errno::EINVAL) =::
!STACK 0
org.jruby.exceptions.RaiseException: (Errno::EINVAL) =::
at org.jruby.RubyHash.replace(org/jruby/RubyHash.java:1623)
I don't know how to handle this error. Do I have to install anything else to use the Content Assist with Ruby on Rails?
I found a solution at https://jira.appcelerator.org/browse/APSTUD-2718
As a workaround:
1) Commands > Rails Bundle > Edit this Bundle will grab a copy of the
new code
This removed the error messages for me.
I have found this link, that describes my problem as "Unresolved" (reported in 12/Sep/12):
https://jira.appcelerator.org/browse/APSTUD-7406
But this is "Aptana Studio 3.2.2" and I have got Version 3.3.3, I can't believe that this problem isn't solved.
Anybody else using Aptana knowing this problem?

Rails 3, JRuby and Warbler

I am trying to deploy a Rails 3 application on Tomcat 6.0.24. The JRuby version is 1.6.2 (ruby-1.8.7-p330) and Warbler is 1.3.0. I use bundler to handle the gem dependencies.
Checked the WEB-INF/lib folder and the following jars are present:
jruby-rack-1.0.9.jar
jruby-core-1.6.2.jar
jruby-stdlib-1.6.2.jar
But, however after the server starts, hitting the application results in the following exception:
javax.servlet.ServletException: Filter execution threw an exception
java.lang.NoClassDefFoundError: Could not initialize class com.kenai.jaffl.struct.Struct$Constants
com.kenai.jaffl.struct.Struct$Signed64.<init>(Struct.java:1074)
org.jruby.ext.posix.HeapStruct$Int64.<init>(HeapStruct.java:41)
org.jruby.ext.posix.LinuxHeapFileStat.<init>(LinuxHeapFileStat.java:35)
org.jruby.ext.posix.LinuxPOSIX.allocateStat(LinuxPOSIX.java:26)
org.jruby.ext.posix.LinuxPOSIX.stat(LinuxPOSIX.java:107)
org.jruby.ext.posix.LazyPOSIX.stat(LazyPOSIX.java:226)
org.jruby.RubyFileTest.directory_p(RubyFileTest.java:102)
org.jruby.RubyFileTest.directory_p(RubyFileTest.java:87)
org.jruby.RubyFileTest$FileTestFileMethods.directory_p(RubyFileTest.java:428)
org.jruby.RubyFileTest$FileTestFileMethods$s$1$0$directory_p.call(RubyFileTest$FileTestFileMethods$s$1$0$directory_p.gen:65535)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:282)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:139)
org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
org.jruby.ast.IfNode.interpret(IfNode.java:111)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:75)
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:147)
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:163)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:262)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:105)
org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:63)
org.jruby.ast.IfNode.interpret(IfNode.java:117)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:75)
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:120)
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:145)
org.jruby.runtime.callsite.SuperCallSite.cacheAndCall(SuperCallSite.java:286)
org.jruby.runtime.callsite.SuperCallSite.callBlock(SuperCallSite.java:70)
org.jruby.runtime.callsite.SuperCallSite.call(SuperCallSite.java:75)
org.jruby.ast.ZSuperNode.interpret(ZSuperNode.java:101)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104).....
Does that ring any bells?
[Answer Updated]: The issue was with the java implementation on the server. It was Open JDK. I switched it over to Sun Java 1.6.0_26 and everything started working :)
Not sure if this is a new bug or an old one. Consider googling the error or looking on http://bugs.jruby.org.
You might try setting -Djruby.native.enabled=false in the VM to use the pure-Java POSIX layer and avoid this error.
The issue was with the java implementation on the server. It was Open JDK. I switched it over to Sun Java 1.6.0_26 and everything started working

Resources