Rails 3 with mysql and omniauth => [BUG] Segmentation fault - mysql

I try to run the project together with omniauth (devise + omniauth) and mysql.
For example Twitter authorization gives an error:
/Users/n3mfis/.rvm/rubies/ruby-head/lib/ruby/1.9.1/net/http.rb:784:
[BUG] Segmentation fault ruby 1.9.3dev
(2011-05-18 trunk 31628)
[x86_64-darwin10.7.0]
-- Control frame information ----------------------------------------------- c:0054 p:---- s:0330 b:0330 l:000329
d:000329 CFUNC :connect c:0053 p:0011
s:0327 b:0327 l:000a80 d:000326 BLOCK
/Users/n3mfis/.rvm/rubies/ruby-head/lib/ruby/1.9.1/net/http.rb:784
c:0052 p:0111 s:0325 b:0325 l:0024a0
d:0024a0 METHOD
/Users/n3mfis/.rvm/rubies/ruby-head/lib/ruby/1.9.1/timeout.rb:60
c:0051 p:0026 s:0313 b:0313 l:000312
d:000312 METHOD
/Users/n3mfis/.rvm/rubies/ruby-head/lib/ruby/1.9.1/timeout.rb:91
....
1069
/Users/n3mfis/.rvm/gems/ruby-head/bundler/gems/rails-505defc27ead/activerecord/lib/active_record/relation/predicate_builder.rb
1070
/Users/n3mfis/.rvm/gems/ruby-head/bundler/gems/rails-505defc27ead/activerecord/lib/active_record/associations/collection_proxy.rb
1071
/Users/n3mfis/.rvm/gems/ruby-head/gems/multi_json-1.0.2/lib/multi_json/engines/json_gem.rb 1072
/Users/n3mfis/.rvm/rubies/ruby-head/lib/ruby/1.9.1/x86_64-darwin10.7.0/enc/trans/utf_16_32.bundle
[NOTE] You may have encountered a bug
in the Ruby interpreter or extension
libraries. Bug reports are welcome.
For details:
http://www.ruby-lang.org/bugreport.html
Abort trap
If I change mysql to sqlite, then everything works fine...
For mysql and sqlite other features of the site work fine without any errors (scaffold)
I tried
ruby ruby-1.9.2-p180 and last version ruby 1.9.3dev
rails 3.0.7 and rails 3.1.0beta1

Try to add this option:
export RUBYOPT='-r openssl'

Related

Class PhpStorm_Codeception_ReportPrinter does not exist

I am attempting to run Codeception functional tests within PhpStorm and keep receiving an error that says a class is missing. I've scoured the internet and found nothing available for this problem except for one post https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000646104-Running-codeCeption-test-runner-causes-excpetion?sort_by=created_at . Other posts talk about how to set the argument.
I have both a phar of Codeception 2.4.1 and a composer install of it. It is using PHP version 7.1 to execute.
Searching the vendor folder returns no such class which makes me think it is supposed to be delivered or included from within PhpStorm. Not really sure, grabbing at straws.
If anyone has any exposure to this and can help with some guidance it would be much appreciated. I can run them a docker/vagrant config or from the CLI, it just cannot integrate with PhpStorm.
C:\php\php-7.1.4-Win32-VC14-x64\php.exe -d-dxdebug.remote_mode=jit C:/Users/Curtis/AppData/Local/Temp/ide-codeception.php run --report -o "reporters: report: PhpStorm_Codeception_ReportPrinter" --no-ansi --no-interaction functional
==== Redirecting to Composer-installed version in vendor/codeception ====
Codeception PHP Testing Framework v2.4.1
Powered by PHPUnit 5.7.27 by Sebastian Bergmann and contributors.
In Runner.php line 174:
Class PhpStorm_Codeception_ReportPrinter does not exist
run [-o|--override OVERRIDE] [-e|--ext EXT] [--report] [--html [HTML]] [--xml [XML]] [--tap [TAP]] [--json [JSON]] [--colors] [--no-colors] [--silent] [--steps] [-d|--debug] [--coverage [COVERAGE]] [--coverage-html [COVERAGE-HTML]] [--coverage-xml [COVERAGE-XML]] [--coverage-text [COVERAGE-TEXT]] [--coverage-crap4j [COVERAGE-CRAP4J]] [--coverage-phpunit [COVERAGE-PHPUNIT]] [--no-exit] [-g|--group GROUP] [-s|--skip SKIP] [-x|--skip-group SKIP-GROUP] [--env ENV] [-f|--fail-fast] [--no-rebuild] [--] [<suite>] [<test>]
PHP Fatal error: Uncaught RuntimeException: Command Did Not Finish Properly in C:\Users\Curtis\Projects\tripadvisor-integration\vendor\codeception\codeception\src\Codeception\Subscriber\ErrorHandler.php:101
Stack trace:
#0 [internal function]: Codeception\Subscriber\ErrorHandler->shutdownHandler()
#1 {main}
thrown in C:\Users\Curtis\Projects\tripadvisor-integration\vendor\codeception\codeception\src\Codeception\Subscriber\ErrorHandler.php on line 101
PHP Stack trace:
PHP 1. {main}() C:\Users\Curtis\AppData\Local\Temp\ide-codeception.php:0
PHP 2. require_once() C:\Users\Curtis\AppData\Local\Temp\ide-codeception.php:21
PHP 3. require() phar://C:/Users/Curtis/Projects/tripadvisor-integration/codecept.phar/autoload.php:12
PHP 4. Codeception\Application->run() C:\Users\Curtis\Projects\tripadvisor-integration\vendor\codeception\codeception\package\bin:37
PHP 5. Codeception\Application->run() C:\Users\Curtis\Projects\tripadvisor-integration\vendor\codeception\codeception\src\Codeception\Application.php:108
Fatal error: Uncaught RuntimeException: Command Did Not Finish Properly in C:\Users\Curtis\Projects\tripadvisor-integration\vendor\codeception\codeception\src\Codeception\Subscriber\ErrorHandler.php on line 101
Call Stack:
0.2024 403184 1. {main}() C:\Users\Curtis\AppData\Local\Temp\ide-codeception.php:0
0.2208 1243848 2. require_once('phar://C:/Users/Curtis/Projects/tripadvisor-integration/codecept.phar/autoload.php') C:\Users\Curtis\AppData\Local\Temp\ide-codeception.php:21
0.2862 5654840 3. require('C:\Users\Curtis\Projects\tripadvisor-integration\vendor\codeception\codeception\package\bin') phar://C:/Users/Curtis/Projects/tripadvisor-integration/codecept.phar/autoload.php:12
0.3338 8056520 4. Codeception\Application->run() C:\Users\Curtis\Projects\tripadvisor-integration\vendor\codeception\codeception\package\bin:37
0.3338 8056520 5. Codeception\Application->run() C:\Users\Curtis\Projects\tripadvisor-integration\vendor\codeception\codeception\src\Codeception\Application.php:108
RuntimeException: Command Did Not Finish Properly in C:\Users\Curtis\Projects\tripadvisor-integration\vendor\codeception\codeception\src\Codeception\Subscriber\ErrorHandler.php on line 101
Call Stack:
0.2024 403184 1. {main}() C:\Users\Curtis\AppData\Local\Temp\ide-codeception.php:0
0.2208 1243848 2. require_once('phar://C:/Users/Curtis/Projects/tripadvisor-integration/codecept.phar/autoload.php') C:\Users\Curtis\AppData\Local\Temp\ide-codeception.php:21
0.2862 5654840 3. require('C:\Users\Curtis\Projects\tripadvisor-integration\vendor\codeception\codeception\package\bin') phar://C:/Users/Curtis/Projects/tripadvisor-integration/codecept.phar/autoload.php:12
0.3338 8056520 4. Codeception\Application->run() C:\Users\Curtis\Projects\tripadvisor-integration\vendor\codeception\codeception\package\bin:37
0.3338 8056520 5. Codeception\Application->run() C:\Users\Curtis\Projects\tripadvisor-integration\vendor\codeception\codeception\src\Codeception\Application.php:108
0.6265 17565136 6. Codeception\Subscriber\ErrorHandler->shutdownHandler() C:\Users\Curtis\Projects\tripadvisor-integration\vendor\codeception\codeception\src\Codeception\Subscriber\ErrorHandler.php:0
Process finished with exit code -1
In my case, I had codeception installed both in composer global and as a project dependency.
I had to remove composer global remove codeception/codeception and go to PHPStorm -> Settings -> Languages & Frameworks -> PHP -> Test Frameworks and change my codeception executable to ~/myprojectpath/vendor/codeception/codeception/codecept

Grails db-reverse-engineer fails

I am trying to reverse engineer a database schema and I'm getting the following error:
Command execution error: org.hibernate.cfg.Configuration.buildSettings(Lorg/hibernate/service/ServiceRegistry;)Lorg/hibernate/cfg/Settings;
> Building 85% > :dbReverseEngineer :dbReverseEngineer FAILED
> Building 85%
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':dbReverseEngineer'.
Process 'command '/usr/lib/jvm/java-8-openjdk/bin/java'' finished with non-zero exit value 1
Grails version:
| Grails Version: 3.2.6
| Groovy Version: 2.4.7
| JVM Version: 1.8.0_141
Gradle version:
Gradle 3.4.1
I followed these the instructions.
That plugin was last released with Grails 3.0.x. That used gorm 4, I'm pretty sure. (The docs for Grails 3.1 advertise "What's New" to include gorm 5, and Grails 3.2 advertises gorm 6). Maybe Burt will chime in, but as far as I can tell, this plugin isn't going to work well in Grails 3.2.x without being re-released.
You could try running it in 3.0.11, just to reverse engineer your classes, and then move those into your real project, as a workaround.

JRuby disabled stack guard

I've installed jruby 1.7.4 and every time an program is executed I get the following error:
Java HotSpot(TM) 64-Bit Server VM warning: You have loaded library /opt/jruby/lib/native/arm- Linux/libjffi-1.2.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
I tried to disable the error message with the "execstack -c /opt/jruby/lib/native/arm- Linux/libjffi-1.2.so" but the error keeps creeping in.
How can disable/fix this error message?
simply install a somehow recent of JRuby 1.7.x ... that is e.g. 1.7.17 at the moment

Ruby on Rails and MySQL error

I'm very new to Ruby on Rails, and have been getting the following error every time I run:
rails s
I get the following error:
dyld: lazy symbol binding failed: Symbol not found: _mysql_get_client_info
Referenced from: /Library/Ruby/Gems/1.8/gems/mysql2-0.2.11/lib/mysql2/mysql2.bundle
Expected in: flat namespace
dyld: Symbol not found: _mysql_get_client_info
Referenced from: /Library/Ruby/Gems/1.8/gems/mysql2-0.2.11/lib/mysql2/mysql2.bundle
Expected in: flat namespace
Trace/BPT trap
I've done quite a bit of research on this on StackOverflow and good ol' Google, and have tried the solutions on this post: rails server error ? (rails 3) with editing the .profile file, as well as ensuring that mysql and ruby are were both installed for 64-bit systems.
I'm running on OSX Snow Leopard, using Rails 3.0.9 and Ruby 1.8.7.
Any help would be greatly appreciated!! Thank you! :)
To run Rails 3 you need ruby 1.9.2. I would start there before going any further, please check this link out, your best bet is to use rvm to manage your ruby version. Regards
http://amerine.net/2010/02/24/rvm-rails3-ruby-1-9-2-setup.html

JRuby on Rails app on and JBoss 4.2.0/Tomcat 5.5

My JRuby on rails app works fine on Tomcat 6.0, But when I deploy it on my company's webfarm which is JBoss 4.2.0/Tomcat 5.5 (Servlet API 2.4) It fails with the following stack trace:
java.lang.ArrayIndexOutOfBoundsException: 0
at com.kenai.jaffl.provider.jffi.AsmLibraryLoader.generateBufferInvocation(AsmLibraryLoader.java:548)
at com.kenai.jaffl.provider.jffi.AsmLibraryLoader.generateMethod(AsmLibraryLoader.java:511)
at com.kenai.jaffl.provider.jffi.AsmLibraryLoader.generateInterfaceImpl(AsmLibraryLoader.java:223)
at com.kenai.jaffl.provider.jffi.AsmLibraryLoader.loadLibrary(AsmLibraryLoader.java:125)
at com.kenai.jaffl.provider.jffi.Provider.loadLibrary(Provider.java:31)
at com.kenai.jaffl.provider.jffi.Provider.loadLibrary(Provider.java:25)
at com.kenai.jaffl.Library.loadLibrary(Library.java:76)
at com.kenai.jaffl.Library.loadLibrary(Library.java:48)
at org.jruby.ext.socket.RubyUNIXSocket.tryUnixDomainSocket(RubyUNIXSocket.java:167)
at org.jruby.ext.socket.RubySocket$Service.load(RubySocket.java:103)
at org.jruby.runtime.load.LoadService.reflectedLoad(LoadService.java:384)
at org.jruby.ext.LateLoadingLibrary.load(LateLoadingLibrary.java:49)
at org.jruby.runtime.load.LoadService.tryLoadingLibraryOrScript(LoadService.java:671)
at org.jruby.runtime.load.LoadService.smartLoad(LoadService.java:314)
at org.jruby.runtime.load.LoadService.require(LoadService.java:357)
at org.jruby.runtime.load.LoadService.lockAndRequire(LoadService.java:289)
at org.jruby.RubyKernel.requireCommon(RubyKernel.java:984)
at org.jruby.RubyKernel.require(RubyKernel.java:967)
at org.jruby.RubyKernel$s_method_1_0$RUBYFRAMEDINVOKER$require.call(org/jruby/RubyKernel$s_method_1_0$RUBYFRAMEDINVOKER$require.gen:65535)
at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodOneOrNBlock.call(JavaMethod.java:319)
at org.jruby.internal.runtime.methods.AliasMethod.call(AliasMethod.java:61)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:146)
at ruby.jit.require_120F9897B5F59B6B5FA66BC56E0277183EA7EAA5.rescue_1$RUBY$__rescue___0(custom_require.rb:31)
at ruby.jit.require_120F9897B5F59B6B5FA66BC56E0277183EA7EAA5.__file__(Lruby.jit.require_120F9897B5F59B6B5FA66BC56E0277183EA7EAA5;Lorg.jruby.runtime.ThreadContext;Lorg.jruby.runtime.builtin.IRubyObject;Lorg.jruby.runtime.builtin.IRubyObject;Lorg.jruby.runtime.Block;)Lorg.jruby.runtime.builtin.IRubyObject;(custom_require.rb:???)
at ruby.jit.require_120F9897B5F59B6B5FA66BC56E0277183EA7EAA5.__file__(Lorg.jruby.runtime.ThreadContext;Lorg.jruby.runtime.builtin.IRubyObject;Lorg.jruby.runtime.builtin.IRubyObject;Lorg.jruby.runtime.Block;)Lorg.jruby.runtime.builtin.IRubyObject;(custom_require.rb:???)
at org.jruby.internal.runtime.methods.JittedMethod.call(JittedMethod.java:153)
at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:309)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:148)
at org.jruby.ast.FCallOneArgNode.interpret(FCallOneArgNode.java:36)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
at org.jruby.ast.RootNode.interpret(RootNode.java:129)
and then:
org.jruby.rack.RackInitializationException: stack level too deep
from file:/home/tkjbgrpd/jboss/eap4.2/tmp/deploy/tmp23048subwire-exp.war/WEB-INF/lib/jruby-stdlib-1.5.3.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/version.rb:298:in `<=>'
from file:/home/tkjbgrpd/jboss/eap4.2/tmp/deploy/tmp23048subwire-exp.war/WEB-INF/lib/jruby-stdlib-1.5.3.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/requirement.rb:17
from file:/home/tkjbgrpd/jboss/eap4.2/tmp/deploy/tmp23048subwire-exp.war/WEB-INF/lib/jruby-stdlib-1.5.3.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/requirement.rb:129:in `call'
from file:/home/tkjbgrpd/jboss/eap4.2/tmp/deploy/tmp23048subwire-exp.war/WEB-INF/lib/jruby-stdlib-1.5.3.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/requirement.rb:129:in `satisfied_by?'
from file:/home/tkjbgrpd/jboss/eap4.2/tmp/deploy/tmp23048subwire-exp.war/WEB-INF/lib/jruby-stdlib-1.5.3.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/requirement.rb:129:in `all?'
from file:/home/tkjbgrpd/jboss/eap4.2/tmp/deploy/tmp23048subwire-exp.war/WEB-INF/lib/jruby-stdlib-1.5.3.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/requirement.rb:129:in `satisfied_by?'
from file:/home/tkjbgrpd/jboss/eap4.2/tmp/deploy/tmp23048subwire-exp.war/WEB-INF/lib/jruby-stdlib-1.5.3.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/dependency.rb:202:in `=~'
from /home/tkjbgrpd/jboss/eap4.2/tmp/deploy/tmp23048subwire-exp.war/WEB-INF/gems/gems/bundler-1.0.2/lib/bundler/index.rb:41:in `search_for_all_platforms'
... 321 levels...
Thanks,
Arkadiy
First note that JRuby-Rack changed to servlet 2.5 as of the 0.9.7 release. So in order to run on 5.5 you'll have to downgrade to 0.9.6 or earlier. This may be a bit tricky with Warbler dependencies but you can manually adjust the jars in a Warbler config file using config.java_libs.
As for the errors above, I haven't seen them before. The only thing that comes to mind is that native/ffi support doesn't work in some containers and you may need to disable it with -Djruby.native.enabled=false.
org.jruby.rack.RackInitializationException: stack level too deep
Is probably cause by a low thread stack size. Try increasing it by passing -Xss16k to the JVM. Increase it until you find a value that it's ok to your application.