Debugging Ruby-Code with Aptana - ruby

I'm trying to debug a ruby program using Aptana Studio 3.
When I start the deubgging, I get the following message in the console:
/var/lib/gems/1.9.1/gems/debugger-ide-0.0.2/lib/ruby-debug/command.rb:32: warning: already initialized constant DEF_OPTIONS
/var/lib/gems/1.9.1/gems/debugger-ide-0.0.2/bin/rdebug-ide:56: warning: already initialized constant ARGV
Fast Debugger (ruby-debug-ide 0.4.9) listens on :58828
Exception in DebugThread loop: undefined method `control' for Debugger::SkipCommand:Class
I'm using Stand-Alone Aptana-Studio 3.4.0 on Linux Mint 14 ("Nadia").

Related

Socket warning RAILS 7 with chruby

I need help with this error messages shows when i am trying to start my Ruby on Rails 7 server or console, doesnt affect functionality but its annoying, I am also using Chruby 2.7.5 because server is running on this version compared to my default Ruby version.
/home/ubuntu20/.rubies/ruby-2.7.5/lib/ruby/2.7.0/net/protocol.rb:66: warning: already initialized constant Net::ProtocRetryError
/home/ubuntu20/.gem/ruby/2.7.5/gems/net-protocol-0.1.2/lib/net/protocol.rb:68: warning: previous definition of ProtocRetryError was here
/home/ubuntu20/.rubies/ruby-2.7.5/lib/ruby/2.7.0/net/protocol.rb:206: warning: already initialized constant Net::BufferedIO::BUFSIZE
/home/ubuntu20/.gem/ruby/2.7.5/gems/net-protocol-0.1.2/lib/net/protocol.rb:208: warning: previous definition of BUFSIZE was here
/home/ubuntu20/.rubies/ruby-2.7.5/lib/ruby/2.7.0/net/protocol.rb:503: warning: already initialized constant Net::NetPrivate::Socket
/home/ubuntu20/.gem/ruby/2.7.5/gems/net-protocol-0.1.2/lib/net/protocol.rb:504: warning: previous definition of Socket was here
Loading development environment (Rails 7.0.2.3)
Thanks for help or tips
It's a known problem (https://github.com/ruby/net-protocol/issues/10)
The solution that seems to work is to force-add net-http
bundle add net-http silenced this for me. Hope it helps.

Elasticsearch 7.3 upgrade with homebrew

I was using Elasticsearch 6.8 via homebrew, and I was trying to upgrade to 7.3. Previously, on 6.8 I already got a warning about a log file that did not exist, but the server would still run - so I did nothing.
Now with 7.3, I get an error and the server won’t run:
Exception in thread "main" java.lang.RuntimeException: starting java failed with [1]
output:
[0.002s][error][logging] Error opening log file 'logs/gc.log': No such file or directory
[0.002s][error][logging] Initialization of output 'file=logs/gc.log' using options 'filecount=32,filesize=64m' failed.
error:
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
Invalid -Xlog option '-Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m', see error log for details.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
at org.elasticsearch.tools.launchers.JvmErgonomics.flagsFinal(JvmErgonomics.java:111)
at org.elasticsearch.tools.launchers.JvmErgonomics.finalJvmOptions(JvmErgonomics.java:79)
at org.elasticsearch.tools.launchers.JvmErgonomics.choose(JvmErgonomics.java:57)
at org.elasticsearch.tools.launchers.JvmOptionsParser.main(JvmOptionsParser.java:89)
I tried creating the dir/file where elasticsearch was installed, but that did not work for me (or i did something wrong).
Reference: https://onecompiler.com/questions/3uwszcf3x/homebrew-installed-elasticsearch-failing-to-start
I have fixed this by changing the relative logs/gc.log path to an absolute path. Follow the below steps to solve the issue
Open jvm.options file which is located at /usr/local/etc/elasticsearch/jvm.options
Change the relative path to an absolute path
from the following
# JDK 9+ GC logging
9-:-Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m
to
# JDK 9+ GC logging
9-:-Xlog:gc*,gc+age=trace,safepoint:file=/usr/local/var/log/elasticsearch/gc.log:utctime,pid,tags:filecount=32,filesize=64m
Restart elasticsearch $ brew services restart elasticsearch-full or just start it without daemon - $ elasticsearch

Fatal error: Call to undefined function oci_connect() wamp3x64 instantclient-basic-windows.x64-12.1.0.2.0.zip php5.6

I am using wamp3 64bit, installed native client 12_1x64 but still got same error. Also enable the extention php_oci8_12c.dll in php.ini file but no success
Can anyone help me out, using oracle 12 in 64 bit OS

Random Segmentation Faults (Incomplete Responses) caused by Rails/Nokogiri

I recently updated my Rails application from Rails 3 to Rails 4 and updated Ruby from 1.9 to 2.3. (I later tried 2.2 and 2.1 with the same results).
I'm using Passenger with NGINX. The application runs fine for the most part, but, once every 10 or so requests, was randomly returning this message to the browser:
Incomplete response received from application
The NGINX logs showed the following:
[Client 2-623] Sending 502 response: application did not send a complete response
28741/7f94e2312700 age/Cor/CoreMain.cpp:819 ]: Checking whether to disconnect long-running connections for process 2521, application /home/admin/apps/<myapp>/current/public
App 2059 stderr: request_handler/thread_handler.rb:226 ]: *** Passenger RequestHandler warning: someone tried to connect with an invalid connect password.
stderr: /home/admin/apps/<myapp>/shared/bundle/ruby/2.2.0/gems/builder-3.2.2/lib/builder/xchar.rb:146:
stderr: [BUG]
stderr: Segmentation fault at 0x00000000000000
After some debugging, I found that the issue seemed to be a strip_tags call within my view, and removing it stopped the issue. I assume the segmentation fault has something to do with Nokogiri since Rails sanitization is done by Nokogiri in Rails 4.
This issue is very hard to debug because helper.strip_tags seems to work fine in the console, yet it is causing these issues in the view.
I tried the following to fix the issue with no success:
Make sure libxml2 and all related Nokogiri libraries are installed and up-to-date
Build Nokogiri with and without --use-system-libraries, with and without specifying specific library locations, same issue with any config.
Build with Nokogiri 1.6.0 and 1.6.7. Neither works, although an additional Rails mailer segfault seems to appear when using 1.6.7.
Built on Ruby 2.1, 2.2, 2.3 using RVM. All have the same issue.
Rails 4 secrets.yml is set up correctly with the secret_key_base key.
With strip_tags included, I also get the following Rails application errors randomly. Sometimes the page loads fine, sometimes these errors are triggered:
RuntimeError: rehash occurred during iteration
<my controller>#index
[GEM_ROOT]/gems/nokogiri-1.6.0/lib/nokogiri/xml/document.rb, line 210
NoMethodError: undefined method `empty?' for false:FalseClass
<my controller>#index
[GEM_ROOT]/gems/haml-4.0.7/lib/haml/compiler.rb, line 193

gomobile bind hello error

Go 1.5 and 1.6 both new installs with gvm, I'm trying to create a android binding of the basic hello world example.
Ubuntu 14.4 long support on a old 32bit laptop i use for trying new things. After getting gomobile and gomobile init everything works. can build and install. The android sdk is new and properly set. I just can't find anything about the error.
gomobile bind hello
gomobile: loadExportData failed go install -p=2
-pkgdir=/home/mrlarge/.gvm/pkgsets/go1.6/global/pkg/gomobile/pkg_android_amd64
-tags="" -gcflags=-shared -ldflags=-shared hello failed: exit status 2
hello
/home/mrlarge/.gvm/gos/go1.6/pkg/tool/linux_386/link: -shared and -buildmode=pie are incompatible
P.s. Sorry the top part must of got deleted, Sleepy touchpad error i suppose..
It was an error in go1.6.2 that caused it i downgraded to 1.6 and everything was fixed. Its reported

Resources