Heroku Create Unknown Protocol SSL Error - ruby-on-rails

I'm new to Ruby and have created a site in Rails, I'm trying to run heroku create on my Windows machine and after generating a public key through git gui, I'm getting this error
Uploading ssh public key C:\Users\me/.ssh/id_rsa.pub
c:/ruby/lib/ruby/1.8/net/http.rb:590:in connect': unknown protocol (OpenSSL::SSL::SSLError)
from c:/ruby/lib/ruby/1.8/net/http.rb:590:inconnect'
from c:/ruby/lib/ruby/1.8/net/http.rb:557:in do_start'
from c:/ruby/lib/ruby/1.8/net/http.rb:546:instart'
from c:/ruby/lib/ruby/gems/1.8/gems/rest-client-1.4.2/lib/restclient/request.rb:150:in transmit
from c:/ruby/lib/ruby/gems/1.8/gems/rest-client-1.4.2/lib/restclient/request.rb:55:inexecute'
from c:/ruby/lib/ruby/gems/1.8/gems/rest-client-1.4.2/lib/restclient/request.rb:30:in execute'
from c:/ruby/lib/ruby/gems/1.8/gems/rest-client-1.4.2/lib/restclient/resource.rb:63:inpost'
from c:/ruby/lib/ruby/gems/1.8/gems/heroku-1.9.9/lib/heroku/client.rb:464:in send'
... 17 levels...
from c:/ruby/lib/ruby/gems/1.8/gems/heroku-1.9.9/lib/heroku/command.rb:20:inrun'
from c:/ruby/lib/ruby/gems/1.8/gems/heroku-1.9.9/bin/heroku:13
from c:/ruby/bin/heroku:19:in `load'
from c:/ruby/bin/heroku:19
Is there something I need to set up for SSL?
Thanks for any help in advance.

I'd try reinstalling Ruby using something like http://rubyinstaller.org/

Related

Selenium Net::ReadTimeout on tests that pass instantly without #javascript tag - Ruby Cucumber tests

FINAL EDIT: I gave up and just did a full reinstallation of WSL2 and everything. Worked great. So if you're somehow dealing with this same problem, a hard reset may be a viable option.
I have already looked at many previous Stack Overflow posts, most notably this one whose second solution is echoed across most other posts on the topic, which is to extend the internal timeout to allot more time for the browser to load pages that take more than the default 60sec.
The Cucumber tests I'm running are small (the one I'm using as a baseline for this is 4 scenarios with 16 steps) and pass virtually instantly when not using Selenium, the pages are mostly static and I just want to be able to see it run+process popups in future tests, so I don't need more load time.
These tests were all working perfectly fine a few months ago (June), but when I reopened the same repo, completely unmodified now I'm unable to run any of the tests with selenium - it doesn't even open the browser anymore when run. As such, I get the feeling it doesn't have to do with my project settings, because none of it has changed. Even so, I've uninstalled the gems and reinstalled them, updated them, all to no avail. I don't know what local system settings/environment variables could have changed during this time, as I work on the app exclusively through WSL2, which I haven't touched since the last time I opened this specific project. Any ideas on this front would be very welcome.
The only configuration I've done for Capybara is setting Capybara.javascript_driver to either :selenium or :selenium_headless between testing sessions in my env.rb file, everything else is running default. My firefox and geckodriver versions are compatible.
Versions:
Ubuntu - 20.04.1 LTS
Ruby - 2.5.3
Firefox - 92.0
Geckodriver - 0.29.1
xfce4 - 4.14 (ran apt list -a xfce4, as xfce4-about gave me an error: 17:02:48.578: No vendor information found in "/usr/share/xfce4/vendorinfo".
Relevant (?) Gems :
selenium-webdriver (4.0.0.rc1)
webdriver (0.18.0)
cucumber (7.0.0)
cucumber-rails (2.4.0)
Please let me know if more information of any type is required, thank you.
EDIT: Relevant Github repos: last working version from a few months ago, most recent development branch as of this post
EDIT 2,4,5: Logs for one Cucumber scenario after setting geckodriver log level to trace:
2021-09-15 17:42:19 DEBUG Selenium Executing Process ["/usr/bin/geckodriver", "--port=4444"]
2021-09-15 17:42:19 DEBUG Selenium polling for socket on ["127.0.0.1", 4444]
1631752939382 geckodriver INFO Listening on 127.0.0.1:4444
2021-09-15 17:42:19 WARN Selenium [DEPRECATION] [:browser_options] :options as a parameter for driver initialization is deprecated. Use :capabilities with an Array of value capabilities/options if necessary instead.
2021-09-15 17:42:19 INFO Selenium -> POST session
2021-09-15 17:42:19 INFO Selenium >>> http://127.0.0.1:4444/session | {"capabilities":{"alwaysMatch":{"browserName":"firefox","moz:firefoxOptions":{"log":{"level":"trace"}}}}}
2021-09-15 17:42:19 DEBUG Selenium > {"Accept"=>"application/json", "Content-Type"=>"application/json; charset=UTF-8", "User-Agent"=>"selenium/4.0.0.rc1 (ruby linux)", "Content-Length"=>"105"}
1631752939650 mozrunner::runner INFO Running command: "/usr/bin/firefox" "--marionette" "-no-remote" "-profile" "/tmp/rust_mozprofileqR2HiM"
1631752939651 geckodriver::marionette DEBUG Waiting 60s to connect to browser on 127.0.0.1:46793
Net::ReadTimeout (Net::ReadTimeout)
/usr/share/rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/net/protocol.rb:181:in `rbuf_fill'
/usr/share/rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/net/protocol.rb:157:in `readuntil'
/usr/share/rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/net/protocol.rb:167:in `readline'
/usr/share/rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/net/http/response.rb:40:in `read_status_line'
/usr/share/rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/net/http/response.rb:29:in `read_new'
/usr/share/rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/net/http.rb:1494:in `block in transport_request'
/usr/share/rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/net/http.rb:1491:in `catch'
/usr/share/rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/net/http.rb:1491:in `transport_request'
/usr/share/rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/net/http.rb:1464:in `request'
/usr/share/rvm/gems/ruby-2.5.3/gems/selenium-webdriver-4.0.0.rc1/lib/selenium/webdriver/remote/http/default.rb:124:in `response_for'
/usr/share/rvm/gems/ruby-2.5.3/gems/selenium-webdriver-4.0.0.rc1/lib/selenium/webdriver/remote/http/default.rb:77:in `request'
/usr/share/rvm/gems/ruby-2.5.3/gems/selenium-webdriver-4.0.0.rc1/lib/selenium/webdriver/remote/http/common.rb:59:in `call'
/usr/share/rvm/gems/ruby-2.5.3/gems/selenium-webdriver-4.0.0.rc1/lib/selenium/webdriver/remote/bridge.rb:589:in `execute'
/usr/share/rvm/gems/ruby-2.5.3/gems/selenium-webdriver-4.0.0.rc1/lib/selenium/webdriver/remote/bridge.rb:52:in `create_session'
/usr/share/rvm/gems/ruby-2.5.3/gems/selenium-webdriver-4.0.0.rc1/lib/selenium/webdriver/common/driver.rb:338:in `create_bridge'
/usr/share/rvm/gems/ruby-2.5.3/gems/selenium-webdriver-4.0.0.rc1/lib/selenium/webdriver/common/driver.rb:73:in `initialize'
/usr/share/rvm/gems/ruby-2.5.3/gems/selenium-webdriver-4.0.0.rc1/lib/selenium/webdriver/common/driver.rb:53:in `new'
/usr/share/rvm/gems/ruby-2.5.3/gems/selenium-webdriver-4.0.0.rc1/lib/selenium/webdriver/common/driver.rb:53:in `for'
/usr/share/rvm/gems/ruby-2.5.3/gems/selenium-webdriver-4.0.0.rc1/lib/selenium/webdriver.rb:87:in `for'
/home/nacho/Github/cs370/features/support/env.rb:18:in `<top (required)>'
/usr/share/rvm/gems/ruby-2.5.3/gems/cucumber-7.0.0/lib/cucumber/glue/registry_and_more.rb:121:in `require'
/usr/share/rvm/gems/ruby-2.5.3/gems/cucumber-7.0.0/lib/cucumber/glue/registry_and_more.rb:121:in `load_code_file'
/usr/share/rvm/gems/ruby-2.5.3/gems/cucumber-7.0.0/lib/cucumber/runtime/support_code.rb:142:in `load_file'
/usr/share/rvm/gems/ruby-2.5.3/gems/cucumber-7.0.0/lib/cucumber/runtime/support_code.rb:81:in `block in load_files!'
/usr/share/rvm/gems/ruby-2.5.3/gems/cucumber-7.0.0/lib/cucumber/runtime/support_code.rb:80:in `each'
/usr/share/rvm/gems/ruby-2.5.3/gems/cucumber-7.0.0/lib/cucumber/runtime/support_code.rb:80:in `load_files!'
/usr/share/rvm/gems/ruby-2.5.3/gems/cucumber-7.0.0/lib/cucumber/runtime.rb:260:in `load_step_definitions'
/usr/share/rvm/gems/ruby-2.5.3/gems/cucumber-7.0.0/lib/cucumber/runtime.rb:72:in `run!'
/usr/share/rvm/gems/ruby-2.5.3/gems/cucumber-7.0.0/lib/cucumber/cli/main.rb:29:in `execute!'
/usr/share/rvm/gems/ruby-2.5.3/gems/cucumber-7.0.0/bin/cucumber:9:in `<top (required)>'
/usr/share/rvm/gems/ruby-2.5.3/bin/cucumber:23:in `load'
/usr/share/rvm/gems/ruby-2.5.3/bin/cucumber:23:in `<main>'
/usr/share/rvm/gems/ruby-2.5.3/bin/ruby_executable_hooks:24:in `eval'
/usr/share/rvm/gems/ruby-2.5.3/bin/ruby_executable_hooks:24:in `<main>'
EDIT 3: I've been poring through the log and googling various terms/lines, I'm not really coming up with too much that I know how to work with, though. A few things I've done:
Connect to 127.0.0.1:35213 and its variants, as it changes each time I run the tests, and saw a working version of my app
Tried to connect to the various sockets it was listening to like 127.0.0.1:4487 and 127.0.0.1:4487/session which stays the same between tests, but it would either a) not load or b) return a blank page with the text HTTP method not allowed in plain HTML
not sure what the webdriver 0.18.0 gem is? But if you can push up a repo that we can pull down and triage, I'd be happy to help.
From your original post there's also nothing reproducible. So let us know once you have a github link. I'd wager the issue is your project / pc settings
I gave up trying to fix anything and just uninstalled Ubuntu and reinstalled it, went through the full setup process again but omitted xfce4 because I realized I didn't need it for my purposes. Fresh start worked out, wish I'd done this three hours in instead of four days in. Live and learn, I suppose.

`block (2 levels) in package_helper': undefined method `join' for nil:NilClass

I'm trying to host my first app using ec2 and rubber.
While running cap rubber:create_staging I got this error:
rubber/recipes/rubber/setup.rb:635:in `block (2 levels) in package_helper': undefined method `join' for nil:NilClass (NoMethodError)
The error is internal to the gem, but I'm not sure if I did something to cause it.
Previously I had a problem with the AMI. Provided as the default in rubber.yml was
image_type: c1.medium
image_id: ami-90c574f8
But something wasn't working with that so I went to the recommended website and got:
image_type: t2.micro
image_id: ami-12a3247a
Although I didn't launch the instance from the Amazon console it seemed to work fine.
Also, when asked for Hostname to use for staging instance [production]: I got it confused with the default domain foo (I realized my mistake immediately) and so now I have foo.foo.com all over the place. I tried changing it to foo.com in etc/hosts and .ssh/known_hostsbut have been unsuccessful so far.
Had the same bug and saw your issue on github for rubber. I figured out what could have been a possible reason. See my issue:
https://github.com/rubber/rubber/issues/546

How to use rails bundler behind a authenticated proxy?

I am new to ruby and getting started to learn ruby on rails.
I am behind authenticated proxy network.
I researched on the internet, however the answers didn't work for me.
Password has special characters
I have exported http_proxy in ruby shell
export http_proxy=ht tp://foo:b\#r\#192.168.1.1:8080
When issued bundle update I get below error
:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/uri/generic.rb:213:in `initialize': the scheme http does not accept registry part: foo:b#r#192.168.1.1:8080 (or bad hostname?) (URI::InvalidURIError)
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/uri/http.rb:84:in `initialize'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/uri/common.rb:214:in `new'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/uri/common.rb:214:in `parse'
I tried remove \ before 2 in both places, but didn't work.
I have put this content in .gemrc file in the folder where I create first_app
Yet didn't work.
Anyone who has used Rails behind authenticated proxy, please help me?

heroku ssl endpoint add cert give internal error, update gives undefined first for nil

My SSL certificate expired, so I followed the directions to create an csr, activate my renewed cert, and cat the key and certs together. From comodo through namecheap. An update now says:
$ heroku certs:update reserver.pem reserver.key
c:/Program Files (x86)/Heroku/lib/heroku/command/certs.rb:110:in current_endpoint': undef
ined methodfirst' for nil:NilClass (NoMethodError)
from c:/Program Files (x86)/Heroku/lib/heroku/command/certs.rb:79:in update'
from c:/Program Files (x86)/Heroku/lib/heroku/command.rb:148:inrun'
from c:/Program Files (x86)/Heroku/lib/heroku/cli.rb:9:in start'
from c:/Program Files (x86)/Heroku/bin/heroku:28:in'
and add now says the same as this other question
Heroku SSL EndPoint -- update cert gives Internal server error
:
$ heroku certs:add reserver.pem reserver.key
Adding SSL endpoint to
Most other heroku certs commands also have issues with undefined methods for nil.
I've repeated the process multiple times, and I believe my certs are okay. Additional ideas to troubleshoot or fix would be welcome.
The solution that worked for me was starting over again on a new computer AND downloading and installing the latest heroku toolbox (and updating the path manually to use the new heroku command). I suspect that doing the same on the old computer would have fixed the issue, as well.

How to run "hello" example in Asana API documentation

How to run "hello" example in Asana API documentation?
C:\Users\Desktop\ruby helloTask.rb
C:/Ruby193/lib/ruby/1.9.1/net/http.rb:799:in `connect': SSL_connect returned=1 e
rrno=0 state=SSLv3 read server certificate B: certificate verify failed (OpenSSL
::SSL::SSLError)
from C:/Ruby193/lib/ruby/1.9.1/net/http.rb:799:in `block in connect'
from C:/Ruby193/lib/ruby/1.9.1/timeout.rb:54:in `timeout'
from C:/Ruby193/lib/ruby/1.9.1/timeout.rb:99:in `timeout'
from C:/Ruby193/lib/ruby/1.9.1/net/http.rb:799:in `connect'
from C:/Ruby193/lib/ruby/1.9.1/net/http.rb:755:in `do_start'
from C:/Ruby193/lib/ruby/1.9.1/net/http.rb:744:in `start'
from helloTask.rb:38:in `<main>'
I tried to run the example mentioned in the Asana API documentation, errors are on the above. Where I went wrong?
(I work at Asana)
If you are using Ruby 1.9, there's a chance it's not properly finding the CA certs properly. If you are on Mac OS X, try (re)installing the curl-ca-bundle:
sudo port install curl-ca-bundle
You may also need to set http.ca_file in some cases. There's a more thorough writeup of this issue at http://martinottenwaelter.fr/2010/12/ruby19-and-the-ssl-error/
Disabling SSL verification would certainly work as well, though that's giving up a lot of the security that SSL provides since you can't be sure you're talking directly to Asana's servers.
I had the same problem after a google I had to change the line:
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
to
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
hope that helps

Resources