I'm getting this error:
OpenSSL::SSL::SSLError
SSL_set_tlsext_host_name:
/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:799:in `connect'
...
Im working on Mac OS X. I already tried reinstalling rvm, openssl (both macports and brew), xcode and different ruby versions and nothing worked.
/Users/Martin/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:799:in `connect'
/Users/Martin/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:799:in `block in connect'
/Users/Martin/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/timeout.rb:68:in `timeout'
/Users/Martin/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/timeout.rb:99:in `timeout'
/Users/Martin/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:799:in `connect'
/Users/Martin/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:755:in `do_start'
/Users/Martin/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:744:in `start'
/Users/Martin/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:1284:in `request'
rest-client (1.6.7) lib/restclient/net_http_ext.rb:51:in `request'
oauth (0.4.5) lib/oauth/consumer.rb:164:in `request'
oauth (0.4.5) lib/oauth/consumer.rb:197:in `token_request'
oauth (0.4.5) lib/oauth/consumer.rb:139:in `get_request_token'
/Users/Martin/.rvm/gems/ruby-1.9.3-p0/bundler/gems/omniauth-af14e6ea9a40/oa-oauth/lib/omniauth/strategies/oauth.rb:31:in `request_phase'
/Users/Martin/.rvm/gems/ruby-1.9.3-p0/bundler/gems/omniauth-af14e6ea9a40/oa-core/lib/omniauth/strategy.rb:58:in `request_call'
/Users/Martin/.rvm/gems/ruby-1.9.3-p0/bundler/gems/omniauth-af14e6ea9a40/oa-core/lib/omniauth/strategy.rb:41:in `call!'
/Users/Martin/.rvm/gems/ruby-1.9.3-p0/bundler/gems/omniauth-af14e6ea9a40/oa-core/lib/omniauth/strategy.rb:30:in `call'
/Users/Martin/.rvm/gems/ruby-1.9.3-p0/bundler/gems/omniauth-af14e6ea9a40/oa-core/lib/omniauth/strategy.rb:44:in `call!'
/Users/Martin/.rvm/gems/ruby-1.9.3-p0/bundler/gems/omniauth-af14e6ea9a40/oa-core/lib/omniauth/strategy.rb:30:in `call'
/Users/Martin/.rvm/gems/ruby-1.9.3-p0/bundler/gems/omniauth-af14e6ea9a40/oa-core/lib/omniauth/strategy.rb:44:in `call!'
/Users/Martin/.rvm/gems/ruby-1.9.3-p0/bundler/gems/omniauth-af14e6ea9a40/oa-core/lib/omniauth/strategy.rb:30:in `call'
/Users/Martin/.rvm/gems/ruby-1.9.3-p0/bundler/gems/omniauth-af14e6ea9a40/oa-core/lib/omniauth/strategy.rb:44:in `call!'
/Users/Martin/.rvm/gems/ruby-1.9.3-p0/bundler/gems/omniauth-af14e6ea9a40/oa-core/lib/omniauth/strategy.rb:30:in `call'
hoptoad_notifier (2.4.11) lib/hoptoad_notifier/rack.rb:27:in `call'
mongoid (2.2.4) lib/rack/mongoid/middleware/identity_map.rb:33:in `block in call'
mongoid (2.2.4) lib/mongoid.rb:130:in `unit_of_work'
mongoid (2.2.4) lib/rack/mongoid/middleware/identity_map.rb:33:in `call'
sass (3.1.10) lib/sass/plugin/rack.rb:54:in `call'
/Users/Martin/.rvm/gems/ruby-1.9.3-p0/bundler/gems/client_side_validations-46f8fc087704/lib/client_side_validations/middleware.rb:16:in `call'
warden (1.0.6) lib/warden/manager.rb:35:in `block in call'
I found the reason of it. I used Mac Postgres installer that modified somehow openssl and gems were build apon it. I removed Postgres install it with brew and all is ok now.
Related
Users are not able lo login from Facebook since July 3rd.
I'm using omniauth-facebook. I tested login successfully from localhost (pointing to another FB test app). But in production the app shows this error:
Started GET "/auth/facebook" for 190.238.101.80 at 2019-07-10 17:53:51 -0500
I, [2019-07-10T17:53:51.594796 #4707] INFO -- omniauth: (facebook) Request phase initiated.
Started GET "/auth/facebook/callback?code=AQAj5FOJuHu7UY656lbwZ4Sfcf_J_ZX9Z_t0wRT-LDfnPLU530zKj5CNGEK53yJ9maNj8O80fWgGmxCq4zWqBK7CPN-ovokGZVIvfY0KaqzNRXWOC20kH4KhkYOHjPyRh4tMYTIcHZ1a0BvHfbBLVolYECVtfD1OKJ2Xob07LCpS0SHNhYc6PA3rBAnb6GnkvOZI-8S7nwXIICdFoKu0BbHd-6L8_Dq-dPFTOpJDSWgmoJUBc65EyCnuw7NCI4IFP1UtxtOmB_QjuzRQV-voQs_SV6N97c2ICK_Qc-IqL_WBwqd54aEzdnW5UOsDV4Wo0jA&state=cee86047aecb4d282b80d33bbd0469815a17d25566167d95" for 190.238.101.80 at 2019-07-10 17:53:52 -0500
I, [2019-07-10T17:53:52.082829 #4707] INFO -- omniauth: (facebook) Callback phase initiated.
Faraday::ConnectionFailed (execution expired):
/usr/lib/ruby/2.5.0/net/http.rb:937:in `initialize'
/usr/lib/ruby/2.5.0/net/http.rb:937:in `open'
/usr/lib/ruby/2.5.0/net/http.rb:937:in `block in connect'
/usr/lib/ruby/2.5.0/timeout.rb:103:in `timeout'
/usr/lib/ruby/2.5.0/net/http.rb:935:in `connect'
/usr/lib/ruby/2.5.0/net/http.rb:920:in `do_start'
/usr/lib/ruby/2.5.0/net/http.rb:909:in `start'
/usr/lib/ruby/2.5.0/net/http.rb:1458:in `request'
faraday (0.15.4) lib/faraday/adapter/net_http.rb:87:in `perform_request'
faraday (0.15.4) lib/faraday/adapter/net_http.rb:43:in `block in call'
faraday (0.15.4) lib/faraday/adapter/net_http.rb:92:in `with_net_http_connection'
faraday (0.15.4) lib/faraday/adapter/net_http.rb:38:in `call'
faraday (0.15.4) lib/faraday/request/url_encoded.rb:15:in `call'
faraday (0.15.4) lib/faraday/rack_builder.rb:143:in `build_response'
faraday (0.15.4) lib/faraday/connection.rb:387:in `run_request'
oauth2 (1.4.1) lib/oauth2/client.rb:99:in `request'
oauth2 (1.4.1) lib/oauth2/client.rb:146:in `get_token'
oauth2 (1.4.1) lib/oauth2/strategy/auth_code.rb:30:in `get_token'
omniauth-oauth2 (1.6.0) lib/omniauth/strategies/oauth2.rb:89:in `build_access_token'
omniauth-facebook (5.0.0) lib/omniauth/strategies/facebook.rb:110:in `build_access_token'
omniauth-oauth2 (1.6.0) lib/omniauth/strategies/oauth2.rb:73:in `callback_phase'
omniauth-facebook (5.0.0) lib/omniauth/strategies/facebook.rb:67:in `block in callback_phase'
omniauth-facebook (5.0.0) lib/omniauth/strategies/facebook.rb:131:in `with_authorization_code!'
omniauth-facebook (5.0.0) lib/omniauth/strategies/facebook.rb:66:in `callback_phase'
omniauth (1.9.0) lib/omniauth/strategy.rb:238:in `callback_call'
omniauth (1.9.0) lib/omniauth/strategy.rb:189:in `call!'
omniauth (1.9.0) lib/omniauth/strategy.rb:169:in `call'
omniauth (1.9.0) lib/omniauth/builder.rb:64:in `call'
rack (1.6.11) lib/rack/etag.rb:24:in `call'
rack (1.6.11) lib/rack/conditionalget.rb:25:in `call'
rack (1.6.11) lib/rack/head.rb:13:in `call'
actionpack (4.2.8) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.2.8) lib/action_dispatch/middleware/flash.rb:260:in `call'
rack (1.6.11) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.6.11) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.2.8) lib/action_dispatch/middleware/cookies.rb:560:in `call'
activerecord (4.2.8) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.2.8) lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
actionpack (4.2.8) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.2.8) lib/active_support/callbacks.rb:88:in `__run_callbacks__'
activesupport (4.2.8) lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
activesupport (4.2.8) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (4.2.8) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.2.8) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
actionpack (4.2.8) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.2.8) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.2.8) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.2.8) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.2.8) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.2.8) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.2.8) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.2.8) lib/rails/rack/logger.rb:20:in `call'
actionpack (4.2.8) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.6.11) lib/rack/methodoverride.rb:22:in `call'
rack (1.6.11) lib/rack/runtime.rb:18:in `call'
activesupport (4.2.8) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
actionpack (4.2.8) lib/action_dispatch/middleware/static.rb:120:in `call'
rack (1.6.11) lib/rack/sendfile.rb:113:in `call'
actionpack (4.2.8) lib/action_dispatch/middleware/ssl.rb:24:in `call'
railties (4.2.8) lib/rails/engine.rb:518:in `call'
railties (4.2.8) lib/rails/application.rb:165:in `call'
rack (1.6.11) lib/rack/content_length.rb:15:in `call'
thin (1.7.2) lib/thin/connection.rb:86:in `block in pre_process'
thin (1.7.2) lib/thin/connection.rb:84:in `catch'
thin (1.7.2) lib/thin/connection.rb:84:in `pre_process'
thin (1.7.2) lib/thin/connection.rb:53:in `process'
thin (1.7.2) lib/thin/connection.rb:39:in `receive_data'
eventmachine (1.2.7) lib/eventmachine.rb:195:in `run_machine'
eventmachine (1.2.7) lib/eventmachine.rb:195:in `run'
thin (1.7.2) lib/thin/backends/base.rb:73:in `start'
thin (1.7.2) lib/thin/server.rb:162:in `start'
rack (1.6.11) lib/rack/handler/thin.rb:19:in `run'
rack (1.6.11) lib/rack/server.rb:287:in `start'
railties (4.2.8) lib/rails/commands/server.rb:80:in `start'
railties (4.2.8) lib/rails/commands/commands_tasks.rb:80:in `block in server'
railties (4.2.8) lib/rails/commands/commands_tasks.rb:75:in `tap'
railties (4.2.8) lib/rails/commands/commands_tasks.rb:75:in `server'
railties (4.2.8) lib/rails/commands/commands_tasks.rb:39:in `run_command!'
railties (4.2.8) lib/rails/commands.rb:17:in `<top (required)>'
bin/rails:8:in `require'
bin/rails:8:in `<main>'
I tried creating a test app with Facebook using localhost and it works.
I tried with another app in production with another domain and it works.
It does not work with this particular application in production. I messaged Facebook support, but they don't reply, and days have passed.
I'm using RoR 4.2.8, with Bundler 1.17.3
I tried with ruby-2.5.1 and ruby-2.3.3 just in case (same error)
I tried with another Facebook app with identical settings, using another RoR v5 app with ruby-2.6 and it worked, so the FB app settings seem to be ok.
I created another FB app, to try with the failing RoR v4.2.8 app, and it fails with the same "Faraday::ConnectionFailed (execution expired):" error.
config/initializers/omniauth.rb
Rails.application.config.middleware.use OmniAuth::Builder do
provider :facebook, 'APP-ID', 'SECRET',
scope: 'email'
end
Users should be able lo login using Facebook, but it fails with "Faraday::ConnectionFailed (execution expired):"
From what it looks like is you are having a network issue where Faraday isn't set up to wait long enough for a response. All I can really tell from the trace is that somewhere along the trail to facebook and back you're encountering network issues.
A couple of things I can think to check:
If your site is running through HTTPS, ensure your certificate is working properly.
Check that your gemfile is set to require a specific version of omniauth-facebook that is compatible with your version of Rails and dependencies.
Extend the timeout length for Faraday
Use a retry gem like https://github.com/ooyala/retries to try and give the network enough time to respond before Faraday closes the connection.
A few other people have commented on this issue in omniauth-facebook's github https://github.com/mkdynamic/omniauth-facebook/issues/283
I used sample of https://github.com/igaiga/omniauth-sample, it just stucked at the callback phase.
I've also tested some other samples, the result were same.
Started GET "/auth/facebook/callback?state=118c21d7ea5675990e0a5e8a876f041f59dbc9a925f94754&code=AQDp93hH-WQor4ZQ8S_ZIGw0dTARw5vPMmkNAiRW9Ql8n7-fny0R5Du88InAILPbXUmdwWh_MyMpZzHzhO2YSlDXeMclSdyDfQQbtlFqixnYgpFt_3Sx5DETKIAYj2amRhK6JaNvxT1ffXgJ6qbMfHUbXlaerFWep60RVHBqwdA6tS-AoPQBNbKSA52-YAhj9-McGoEl4LQi4PGkIpVZu9IV" for 127.0.0.1 at 2013-04-07 16:51:24 +0800
Errno::ETIMEDOUT (Operation timed out - SSL_connect):
/Users/mac/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/net/http.rb:799:in `connect'
/Users/mac/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/net/http.rb:799:in `block in connect'
/Users/mac/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/timeout.rb:54:in `timeout'
/Users/mac/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/timeout.rb:99:in `timeout'
/Users/mac/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/net/http.rb:799:in `connect'
/Users/mac/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/net/http.rb:755:in `do_start'
/Users/mac/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/net/http.rb:744:in `start'
/Users/mac/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/net/http.rb:1284:in `request'
faraday (0.8.7) lib/faraday/adapter/net_http.rb:75:in `perform_request'
faraday (0.8.7) lib/faraday/adapter/net_http.rb:38:in `call'
faraday (0.8.7) lib/faraday/request/url_encoded.rb:14:in `call'
faraday (0.8.7) lib/faraday/connection.rb:247:in `run_request'
oauth2 (0.8.1) lib/oauth2/client.rb:88:in `request'
oauth2 (0.8.1) lib/oauth2/client.rb:131:in `get_token'
oauth2 (0.8.1) lib/oauth2/strategy/auth_code.rb:29:in `get_token'
omniauth-oauth2 (1.1.1) lib/omniauth/strategies/oauth2.rb:99:in `build_access_token'
omniauth-facebook (1.4.1) lib/omniauth/strategies/facebook.rb:73:in `block in build_access_token'
omniauth-facebook (1.4.1) lib/omniauth/strategies/facebook.rb:174:in `with_authorization_code!'
omniauth-facebook (1.4.1) lib/omniauth/strategies/facebook.rb:73:in `build_access_token'
omniauth-oauth2 (1.1.1) lib/omniauth/strategies/oauth2.rb:74:in `callback_phase'
omniauth (1.1.3) lib/omniauth/strategy.rb:219:in `callback_call'
omniauth (1.1.3) lib/omniauth/strategy.rb:175:in `call!'
omniauth (1.1.3) lib/omniauth/strategy.rb:157:in `call'
omniauth (1.1.3) lib/omniauth/strategy.rb:177:in `call!'
omniauth (1.1.3) lib/omniauth/strategy.rb:157:in `call'
omniauth (1.1.3) lib/omniauth/builder.rb:48:in `call'
actionpack (3.2.13) lib/action_dispatch/middleware/best_
The reason is I'm behind the GFW of china. For some reason goagent does not help in this problem, and vpn only helps in case of facebook. The good news is when I deployed the codes to heroku it works for both facebook and twitter.
I'm working on developing a refinerycms rails app that was working good locally and now i've moved it to my VPS and I was having issues with images that i uploaded through refinerycms not loading and i've been reading that i needed to upgrade my version of imagemagick. I upgraded from 6.2.8 to 6.7.8. Now the images all load on some pages, but not on the admin side.
What is causing this issue? Here's the stacktrace of the error.
Dragonfly::Shell::CommandFailed (Command failed (convert '/var/www/vhosts/tomstestsite.us/PersonalTrainingKT/public/system/refinery/images/2012/06/03/16_36_48_339_pamLemke_after.jpg' '-resize' '225x255>' '/tmp/dragonfly20120705-7812-1xb3pce') with exit status 127):
dragonfly (0.9.12) lib/dragonfly/shell.rb:29:in `raise_shell_command_failed'
dragonfly (0.9.12) lib/dragonfly/shell.rb:23:in `run'
dragonfly (0.9.12) lib/dragonfly/image_magick/utils.rb:17:in `convert'
dragonfly (0.9.12) lib/dragonfly/image_magick/processor.rb:103:in `convert'
dragonfly (0.9.12) lib/dragonfly/image_magick/processor.rb:27:in `resize'
dragonfly (0.9.12) lib/dragonfly/image_magick/processor.rb:87:in `thumb'
dragonfly (0.9.12) lib/dragonfly/function_manager.rb:39:in `call'
dragonfly (0.9.12) lib/dragonfly/function_manager.rb:39:in `block (2 levels) in call_last'
dragonfly (0.9.12) lib/dragonfly/function_manager.rb:38:in `catch'
dragonfly (0.9.12) lib/dragonfly/function_manager.rb:38:in `block in call_last'
dragonfly (0.9.12) lib/dragonfly/function_manager.rb:37:in `each'
dragonfly (0.9.12) lib/dragonfly/function_manager.rb:37:in `call_last'
dragonfly (0.9.12) lib/dragonfly/processor.rb:5:in `process'
dragonfly (0.9.12) lib/dragonfly/job.rb:79:in `apply'
dragonfly (0.9.12) lib/dragonfly/job.rb:253:in `block in apply'
dragonfly (0.9.12) lib/dragonfly/job.rb:253:in `each'
dragonfly (0.9.12) lib/dragonfly/job.rb:253:in `apply'
dragonfly (0.9.12) lib/dragonfly/response.rb:25:in `to_response'
dragonfly (0.9.12) lib/dragonfly/server.rb:43:in `block in call'
dragonfly (0.9.12) lib/dragonfly/server.rb:39:in `catch'
dragonfly (0.9.12) lib/dragonfly/server.rb:39:in `call'
dragonfly (0.9.12) lib/dragonfly/middleware.rb:11:in `call'
rack-cache (1.2) lib/rack/cache/context.rb:136:in `forward'
rack-cache (1.2) lib/rack/cache/context.rb:245:in `fetch'
rack-cache (1.2) lib/rack/cache/context.rb:185:in `lookup'
rack-cache (1.2) lib/rack/cache/context.rb:66:in `call!'
rack-cache (1.2) lib/rack/cache/context.rb:51:in `call'
rack-cache (1.2) lib/rack/cache/context.rb:136:in `forward'
rack-cache (1.2) lib/rack/cache/context.rb:245:in `fetch'
rack-cache (1.2) lib/rack/cache/context.rb:185:in `lookup'
rack-cache (1.2) lib/rack/cache/context.rb:66:in `call!'
rack-cache (1.2) lib/rack/cache/context.rb:51:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/reloader.rb:65:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.3) lib/rails/rack/logger.rb:26:in `call_app'
railties (3.2.3) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.4.1) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.1) lib/rack/runtime.rb:17:in `call'
activesupport (3.2.3) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.4.1) lib/rack/lock.rb:15:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/static.rb:62:in `call'
railties (3.2.3) lib/rails/engine.rb:479:in `call'
railties (3.2.3) lib/rails/application.rb:220:in `call'
railties (3.2.3) lib/rails/railtie/configurable.rb:30:in `method_missing'
passenger (3.0.11) lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'
passenger (3.0.11) lib/phusion_passenger/abstract_request_handler.rb:513:in `accept_and_process_next_request'
passenger (3.0.11) lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
passenger (3.0.11) lib/phusion_passenger/classic_rails/application_spawner.rb:321:in `start_request_handler'
passenger (3.0.11) lib/phusion_passenger/classic_rails/application_spawner.rb:275:in `block in handle_spawn_application'
passenger (3.0.11) lib/phusion_passenger/utils.rb:479:in `safe_fork'
passenger (3.0.11) lib/phusion_passenger/classic_rails/application_spawner.rb:270:in `handle_spawn_application'
passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:180:in `start'
passenger (3.0.11) lib/phusion_passenger/classic_rails/application_spawner.rb:149:in `start'
passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:219:in `block (2 levels) in spawn_rails_application'
passenger (3.0.11) lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:214:in `block in spawn_rails_application'
passenger (3.0.11) lib/phusion_passenger/abstract_server_collection.rb:82:in `block in synchronize'
<internal:prelude>:10:in `synchronize'
passenger (3.0.11) lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:213:in `spawn_rails_application'
passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:132:in `spawn_application'
passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
passenger (3.0.11) helper-scripts/passenger-spawn-server:99:in `<main>'
UPDATE
I've added the code below to my config/application.rb file as suggested here and it helped some of the files show up, and but i'm still unable to upload a file through the app and part of this stacktrace is shown below.
config/application.rb contains this
initializer 'override-image-magick-paths', :after => 'attach-refinery-images-with-
dragonfly' do
app=Dragonfly[:refinery_images]
app.configure_with(:imagemagick)
app.configure do |c|
c.convert_command = "/usr/local/bin/convert" # defaults to "convert"
c.identify_command = "/usr/local/bin/identify" # defaults to "identify"
end
end
stacktrace
Dragonfly::Shell::CommandFailed (Command failed (identify '/tmp/RackMultipart20120708-20096-4m1k9j') with exit status 127):
dragonfly (0.9.12) lib/dragonfly/shell.rb:29:in `raise_shell_command_failed'
dragonfly (0.9.12) lib/dragonfly/shell.rb:23:in `run'
dragonfly (0.9.12) lib/dragonfly/image_magick/utils.rb:34:in `raw_identify'
dragonfly (0.9.12) lib/dragonfly/image_magick/utils.rb:24:in `identify'
dragonfly (0.9.12) lib/dragonfly/image_magick/analyser.rb:44:in `format'
dragonfly (0.9.12) lib/dragonfly/function_manager.rb:39:in `call'
dragonfly (0.9.12) lib/dragonfly/function_manager.rb:39:in `block (2 levels) in call_last'
dragonfly (0.9.12) lib/dragonfly/function_manager.rb:38:in `catch'
dragonfly (0.9.12) lib/dragonfly/function_manager.rb:38:in `block in call_last'
dragonfly (0.9.12) lib/dragonfly/function_manager.rb:37:in `each'
dragonfly (0.9.12) lib/dragonfly/function_manager.rb:37:in `call_last'
dragonfly (0.9.12) lib/dragonfly/analyser.rb:25:in `analyse'
dragonfly (0.9.12) lib/dragonfly/job.rb:247:in `analyse'
I simply reinstalled imagemagick and it worked.
I created a symbolic link from /usr/bin/convert -> /usr/local/bin/convert and from /usr/bin/identify -> /usr/local/bin/identify and that seemed to solve my problems.
$ cd /usr/bin
$ ln -s /usr/local/bin/convert convert
$ ln -s /usr/local/bin/identify identify
I'm assuming that dragonfly is still not picking up my location of convert and identify even though i specified it in my config/application.rb file.
You may have to provide the full path to convert:
config/initializers/dragonfly.rb:
app.configure do |c|
c.convert_command = "/usr/bin/convert"
end
Change /usr/bin/convert to the correct path to convert, which you can find out by running whereis convert on your VPS shell.
More details in the documentation.
Try installing the refinery-images gem:
Gemfile:
gem 'refinerycms-page-images', '~>1.0.3' //refinery v1 compatible (v2 available also)
Then in your model:
belongs_to :imagesizeyouwant, :class_name => 'Image'
If you look at the Image class you'll see a pretty nice set up for handling images. You can add image sizes in Refinery's Settings page in the admin tool. If you have a custom engine, just change :imagesizeyouwant to that size (mine was :thumbnail).
When you post the image, look at the output of the identify command and try to run it on your own. Chances are your system has different parameters it uses for ImageMagick binaries, or that the dimensions being sent to it are not understood. Try posting the output of the actual command Dragonfly is calling in the shell so we can take a better look.
I'm trying to get a brand new skeleton app running in rails 3.1.0.rc8. However, whenever any asset tag/helper is used in a view(such as image_tag, javascript_include_tag, etc.), I get a asset compile error. Here's a snippet of my logs/development.log when I make a direct request to /assets/rails.png.
Started GET "/assets/rails.png" for 192.168.0.12 at Mon Aug 29 16:16:21 -0600 2011
Error compiling asset rails.png:
ArgumentError: wrong number of arguments (2 for 1)
activesupport (3.1.0.rc8) lib/active_support/cache/file_store.rb:101:in `respond_to?'
activesupport (3.1.0.rc8) lib/active_support/cache/file_store.rb:101:in `dump'
activesupport (3.1.0.rc8) lib/active_support/cache/file_store.rb:101:in `write_entry'
activesupport (3.1.0.rc8) lib/active_support/core_ext/file/atomic.rb:20:in `atomic_write'
activesupport (3.1.0.rc8) lib/active_support/cache/file_store.rb:101:in `write_entry'
activesupport (3.1.0.rc8) lib/active_support/cache/strategy/local_cache.rb:140:in `write_entry'
activesupport (3.1.0.rc8) lib/active_support/cache.rb:364:in `write'
activesupport (3.1.0.rc8) lib/active_support/cache.rb:520:in `instrument'
activesupport (3.1.0.rc8) lib/active_support/cache.rb:362:in `write'
sprockets (2.0.0.beta.15) lib/sprockets/caching.rb:117:in `cache_set'
sprockets (2.0.0.beta.15) lib/sprockets/caching.rb:80:in `cache_set_hash'
sprockets (2.0.0.beta.15) lib/sprockets/caching.rb:51:in `cache_asset'
sprockets (2.0.0.beta.15) lib/sprockets/environment.rb:82:in `build_asset'
sprockets (2.0.0.beta.15) lib/sprockets/trail.rb:102:in `find_asset_in_path'
sprockets (2.0.0.beta.15) lib/sprockets/base.rb:102:in `find_asset'
sprockets (2.0.0.beta.15) lib/sprockets/environment.rb:72:in `find_asset'
sprockets (2.0.0.beta.15) lib/sprockets/server.rb:42:in `call'
rack-mount (0.8.2) lib/rack/mount/prefix.rb:26:in `call'
rack-mount (0.8.2) lib/rack/mount/route_set.rb:152:in `call'
rack-mount (0.8.2) lib/rack/mount/code_generation.rb:96:in `recognize'
rack-mount (0.8.2) lib/rack/mount/code_generation.rb:68:in `optimized_each'
rack-mount (0.8.2) lib/rack/mount/code_generation.rb:95:in `recognize'
rack-mount (0.8.2) lib/rack/mount/route_set.rb:141:in `call'
actionpack (3.1.0.rc8) lib/action_dispatch/routing/route_set.rb:531:in `call'
actionpack (3.1.0.rc8) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
rack (1.3.2) lib/rack/etag.rb:23:in `call'
rack (1.3.2) lib/rack/conditionalget.rb:25:in `call'
actionpack (3.1.0.rc8) lib/action_dispatch/middleware/head.rb:14:in `call'
actionpack (3.1.0.rc8) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.1.0.rc8) lib/action_dispatch/middleware/flash.rb:243:in `call'
rack (1.3.2) lib/rack/session/abstract/id.rb:195:in `context'
rack (1.3.2) lib/rack/session/abstract/id.rb:190:in `call'
actionpack (3.1.0.rc8) lib/action_dispatch/middleware/cookies.rb:326:in `call'
activerecord (3.1.0.rc8) lib/active_record/query_cache.rb:62:in `call'
activerecord (3.1.0.rc8) lib/active_record/connection_adapters/abstract/connection_pool.rb:477:in `call'
actionpack (3.1.0.rc8) lib/action_dispatch/middleware/callbacks.rb:29:in `call'
activesupport (3.1.0.rc8) lib/active_support/callbacks.rb:392:in `_run_call_callbacks'
activesupport (3.1.0.rc8) lib/active_support/callbacks.rb:81:in `send'
activesupport (3.1.0.rc8) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.1.0.rc8) lib/action_dispatch/middleware/callbacks.rb:28:in `call'
actionpack (3.1.0.rc8) lib/action_dispatch/middleware/reloader.rb:68:in `call'
rack (1.3.2) lib/rack/sendfile.rb:101:in `call'
I'm running ruby 1.8.7 and Passenger, if relevant. Anyone else running into this error?
Fixed this by upgrading from sprockets 2.0.0.beta.15 to 2.0.0:
gem install sprockets -v=2.0.0
Kudos to Ryan Bigg for the help.
I met the same problem when compiling assets via rake task:
$ bundle exec rake assets:precompile --trace
...
** Execute assets:precompile:primary
rake aborted!
wrong number of arguments (2 for 1)
/usr/local/lib/ruby/gems/1.8/gems/activesupport-3.2.0/lib/active_support/cache/file_store.rb:91:in `respond_to?'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-3.2.0/lib/active_support/cache/file_store.rb:91:in `dump'
...
after spending 4+ hours and tried many approaches, I found that it may be an issue of Ruby. ( from this link: https://github.com/resolve/refinerycms/issues/538 )
$ ruby -v
ruby 1.8.7 (2008-05-31 patchlevel 0)
Here the patchlevel 0 is the problem. since my ruby was compiled from the source code. (some reason I can't make it installed from package manager or via RVM).
Solution:
Download a new source file from http://ftp.ruby-lang.org/pub/ruby/1.8/, e.g. patch 358 ,
compile it:
unzip ruby-1.8.7-p358.zip -d /tmp && cd /tmp/ruby-1.8.7-p358 && ./configure && make && sudo make install
now ruby has a new version: patch 358
$ ruby -v
ruby 1.8.7 (2012-02-08 patchlevel 358) [i686-linux]
and everything works!
I have the following configuration:
linux ubuntu 11.04
rails 3.0.9
ruby 1.9.2p290
mysql2 (0.2.7)
I have created first my project using "rails new"
then I have modified the Gemfile to use mysql2 version 0.2.7 (I have read that later versions are working with rails 3.1 only)
Then I changed the file database.yml to use mysql2 instead of sqlite3
But now I'm getting error ActiveRecord::ConnectionNotEstablished when I try to connect to a Controller. Here are the full logs:
activerecord (3.0.9) lib/active_record/connection_adapters/abstract/connection_pool.rb:317:in `retrieve_connection'
activerecord (3.0.9) lib/active_record/connection_adapters/abstract/connection_specification.rb:97:in `retrieve_connection'
activerecord (3.0.9) lib/active_record/connection_adapters/abstract/connection_specification.rb:89:in `connection'
activerecord (3.0.9) lib/active_record/query_cache.rb:12:in `cache'
activerecord (3.0.9) lib/active_record/query_cache.rb:31:in `call'
activerecord (3.0.9) lib/active_record/connection_adapters/abstract/connection_pool.rb:354:in `call'
actionpack (3.0.9) lib/action_dispatch/middleware/callbacks.rb:46:in `call'
activesupport (3.0.9) lib/active_support/callbacks.rb:416:in `_run_call_callbacks'
actionpack (3.0.9) lib/action_dispatch/middleware/callbacks.rb:44:in `call'
rack (1.2.3) lib/rack/sendfile.rb:107:in `call'
actionpack (3.0.9) lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
actionpack (3.0.9) lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
railties (3.0.9) lib/rails/rack/logger.rb:13:in `call'
rack (1.2.3) lib/rack/runtime.rb:17:in `call'
activesupport (3.0.9) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.2.3) lib/rack/lock.rb:11:in `call'
rack (1.2.3) lib/rack/lock.rb:11:in `synchronize'
rack (1.2.3) lib/rack/lock.rb:11:in `call'
actionpack (3.0.9) lib/action_dispatch/middleware/static.rb:30:in `call'
railties (3.0.9) lib/rails/application.rb:168:in `call'
railties (3.0.9) lib/rails/application.rb:77:in `send'
railties (3.0.9) lib/rails/application.rb:77:in `method_missing'
railties (3.0.9) lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.2.3) lib/rack/content_length.rb:13:in `call'
rack (1.2.3) lib/rack/handler/webrick.rb:52:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
rack (1.2.3) lib/rack/handler/webrick.rb:13:in `run'
rack (1.2.3) lib/rack/server.rb:217:in `start'
railties (3.0.9) lib/rails/commands/server.rb:65:in `start'
railties (3.0.9) lib/rails/commands.rb:30
railties (3.0.9) lib/rails/commands.rb:27:in `tap'
railties (3.0.9) lib/rails/commands.rb:27
script/rails:6:in `require'
script/rails:6
PS: I tried almost all solutions provided in this website, but I still have the same issue.
I ended by recreating a new project with the command
rails new -d mysql
And now the pages are retrieved without any problem!
I tried to compare the automatic database.yml file and the manual one, the only diffrence I have noticed was on the user used for mysql database. in the new one the username: root is used.
I came back to the old project and I changed to username/password with root ones I now it is working!!!
I would guess that your database.yml file is incorrect. It should look something like this:
development:
adapter: mysql2
host: localhost
username: root
password: xxxx
database: xxxx
If that doesn't work, try changing localhost to 127.0.0.1