There's a method in my Rails app (intended to be triggered via Rake task) that shells out and runs a PhantomJS process:
bin/proximo bin/phantomjs vendor/assets/javascripts/yslow.js http://www.example.com
The phantomjs executable is 1.8.1 or Linux (x86-64). yslow.js is YSlow for PhantomJS 3.1.1.
The process is run through Heroku's Proximo add-on, because the website I'm running this against (example.com above) will show anti-DOS protection page to any IP that's not whitelisted.
The problem I'm experiencing is that this command simply hangs, returning no output. If I run the same command without executing the bin/proximo wrapper script, it works, but of course I get output for the wrong page, due to the IP restriction mentioned above.
Here is a stack trace from running this directly in a Rails console on Heroku:
irb(main):023:0> `bin/proximo bin/phantomjs vendor/assets/javascripts/yslow.js http://www.example.com`
^CIRB::Abort: abort then interrupt!
from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.11/lib/active_support/core_ext/kernel/agnostics.rb:7:in `call'
from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.11/lib/active_support/core_ext/kernel/agnostics.rb:7:in ``'
from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.11/lib/active_support/core_ext/kernel/agnostics.rb:7:in ``'
from (irb):23
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/commands/console.rb:47:in `start'
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/commands/console.rb:8:in `start'
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/commands.rb:41:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Any ideas what's causing the hang?
Edit: My coworker helped me discover that it's actually PhantomJS that's hanging, not the proxy. I'll look for another way of vendoring PhantomJS, unless someone else has another suggestion.
Edit 2: I installed PhantomJS with the Heroku buildpack, and the same thing happens. I also notice that if I connect to a Bash shell on Heroku and run the phantomjs console, I can't enter commands in it because the enter key does nothing. Not sure if that's related...
Related
I'm trying to use fastlane on Windows, which is installed from Bundler -- which is installed by Ruby Gem. But while running, some internal error of Ruby seems blocked the execution.
First, I went to Ruby Installer and installed Ruby+Devkit 3.0.2-1 (x64); then, I installed the Bundler and Fastlane using gem command. Error below happened when I was trying to execute them -- which I believed was not related to Bundler nor Fastlane:
C:/Ruby30-x64/lib/ruby/3.0.0/reline/ansi.rb:157:in `winsize': Bad file descriptor - <STDIN> (Errno::EBADF)
from C:/Ruby30-x64/lib/ruby/3.0.0/reline/ansi.rb:157:in `get_screen_size'
from C:/Ruby30-x64/lib/ruby/3.0.0/reline.rb:168:in `get_screen_size'
from C:/Ruby30-x64/lib/ruby/3.0.0/forwardable.rb:238:in `get_screen_size'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/tty-screen-0.8.1/lib/tty/screen.rb:236:in `size_from_readline'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/tty-screen-0.8.1/lib/tty/screen.rb:66:in `size'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/tty-screen-0.8.1/lib/tty/screen.rb:76:in `width'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/fastlane-2.197.0/fastlane_core/lib/fastlane_core/print_table.rb:95:in `transform_output'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/fastlane-2.197.0/fastlane/lib/fastlane/plugins/plugin_manager.rb:335:in `print_plugin_information'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/fastlane-2.197.0/fastlane/lib/fastlane/plugins/plugin_manager.rb:316:in `load_plugins'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/fastlane-2.197.0/fastlane/lib/fastlane/commands_generator.rb:39:in `start'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/fastlane-2.197.0/fastlane/lib/fastlane/cli_tools_distributor.rb:122:in `take_off'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/fastlane-2.197.0/bin/fastlane:23:in `<top (required)>'
from C:/Ruby30-x64/bin/fastlane:23:in `load'
from C:/Ruby30-x64/bin/fastlane:23:in `<main>'
I'm using Windows 10 home version 20H2.
Rebooting the computer doesn't solve the problem.
I tried googling the question, but it seems that problem hasn't be reported (or be answered). I don't know where I can report the bug either.
What can I do? Any help would be appreciated!
I had this same error when I tried running bundle exec fastlane in git bash.
I got it working by running it in powershell instead.
Heroku keys, heroku run rake etc seem to be having issues
Anyone else having this issue? / know how to get around it ?
Thanks !
Trace--
! Heroku client internal error.
! Search for help at: https://help.heroku.com
! Or report a bug at: https://github.com/heroku/heroku/issues/new
Error: Unable to verify certificate, please set `Excon.defaults[:ssl_ca_path] = path_to_certs`, `Excon.defaults[:ssl_ca_file] = path_to_file`, or `Excon.defaults[:ssl_verify_peer] = false` (less secure). (Excon::Errors::SocketError)
Backtrace: /usr/local/rvm/gems/ruby-1.9.3-p194/gems/excon-0.25.0/lib/excon/ssl_socket.rb:69:in `connect'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/excon-0.25.0/lib/excon/ssl_socket.rb:69:in `initialize'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/excon-0.25.0/lib/excon/connection.rb:365:in `new'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/excon-0.25.0/lib/excon/connection.rb:365:in `socket'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/excon-0.25.0/lib/excon/connection.rb:105:in `request_call'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/excon-0.25.0/lib/excon/middlewares/mock.rb:42:in `request_call'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/excon-0.25.0/lib/excon/middlewares/instrumentor.rb:22:in `request_call'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/excon-0.25.0/lib/excon/middlewares/base.rb:15:in `request_call'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/excon-0.25.0/lib/excon/middlewares/base.rb:15:in `request_call'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/excon-0.25.0/lib/excon/connection.rb:244:in `request'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/heroku-api-0.3.13/lib/heroku/api.rb:76:in `request'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/heroku-api-0.3.13/lib/heroku/api/login.rb:9:in `post_login'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/heroku-2.39.4/lib/heroku/auth.rb:80:in `api_key'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/heroku-2.39.4/lib/heroku/auth.rb:189:in `ask_for_credentials'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/heroku-2.39.4/lib/heroku/auth.rb:221:in `ask_for_and_save_credentials'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/heroku-2.39.4/lib/heroku/auth.rb:84:in `get_credentials'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/heroku-2.39.4/lib/heroku/auth.rb:74:in `password'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/heroku-2.39.4/lib/heroku/auth.rb:17:in `api'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/heroku-2.39.4/lib/heroku/command/base.rb:40:in `api'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/heroku-2.39.4/lib/heroku/command/keys.rb:27:in `index'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/heroku-2.39.4/lib/heroku/command.rb:206:in `run'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/heroku-2.39.4/lib/heroku/cli.rb:28:in `start'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/heroku-2.39.4/bin/heroku:17:in `<top (required)>'
/usr/local/rvm/gems/ruby-1.9.3-p194/bin/heroku:19:in `load'
/usr/local/rvm/gems/ruby-1.9.3-p194/bin/heroku:19:in `<main>'
/usr/local/rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `eval'
/usr/local/rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `<main>'
Command: heroku keys
Version: heroku-gem/2.39.4 (x86_64-darwin11.4.0) ruby/1.9.3
Running 'heroku update' in terminal fixed this for me.
I had this problem briefly on Mac OS X when I had version 2.39.4 of the heroku gem installed. I uninstalled it and allowed the Heroku toolbelt to be the provider of my heroku executable again, and although I had to go through "heroku auth:login" and "heroku keys:add " again, it now works as expected.
N.B. The heroku gem is still required on my Vagrant Heroku Ubuntu VM, of course.
Need to manually delete openssl.cnf... find the file on your machine and rename it to something else.... bug in the latest excon release....
I was unable to fix this by deleting openssl.conf.
However, I was able to fix this by installing the heroku toolbelt and then deleting ALL old installations of the heroku gem.
macbook:~ johnnygoodman$ gem uninstall heroku
Select gem to uninstall:
1. heroku-2.35.0
2. heroku-2.39.4
3. All versions
> 3
Successfully uninstalled heroku-2.35.0
Remove executables:
heroku
macbook:~ johnnygoodman$ heroku login
Enter your Heroku credentials.
Email:
Password (typing will be hidden):
Authentication successful.
I had the same problem, and renamed the openssl.cnf file on my machine, as user2515011 recommends above, and it's worked.
To be honest, I don't know why this has worked, or if it has left me vulnerable elsewhere. Can anyone explain?
Unfortunately I'm unable to duplicate this on my macbook air. I wonder if perhaps it relates to rvm. What version are you using? It looks as though it used to package openssl: https://rvm.io/packages/openssl (but probably shouldn't any longer, and at least on my machine using the packaged versions works well). Could you try following the advice from that page and running rvm autolibs enable and trying again?
I was having this same problem and none of the suggestions were working for me.
It turns out when trying to fix a different problem I had set an environment variable to set my SSL Certificate location to be in the RailsInstaller directory.
I recommend checking for any suspicious environment variables if none of the above answers are helping you.
Setting up my first developing environment, so bear with me. Running Mountain Lion, Ruby 1.9.3, Gems 1.8.25 and RVM 1.19.1.
Trying to get RSPEC up and running, but I keep getting an error. I think it has to do with my PATH, as most questions about this refer to the fact that their shell (Bash?) is looking in the wrong place.
Using this wonderful tutorial: http://blog.davidchelimsky.net/2007/05/14/an-introduction-to-rspec-part-i/
I've tried running the simplest rspec files and get an error, so I tried just typing "spec" (no quotes) in the command-line. That gives me the error "-bash: spec: command not found" (no quotes).
Looked around stackoverflow and saw that the command was updated to "rspec" instead of "spec"? So when I type "rspec" (no quotes) into the command line I get this nonsense:
Evans-MacBook-Pro:~ Evan$ rspec
/Users/Evan/.rvm/gems/ruby-1.9.3-p392/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:819:in `load': cannot load such file -- /Users/Evan/spec (LoadError)
from /Users/Evan/.rvm/gems/ruby-1.9.3-p392/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:819:in `block in load_spec_files'
from /Users/Evan/.rvm/gems/ruby-1.9.3-p392/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:819:in `each'
from /Users/Evan/.rvm/gems/ruby-1.9.3-p392/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:819:in `load_spec_files'
from /Users/Evan/.rvm/gems/ruby-1.9.3-p392/gems/rspec-core-2.13.1/lib/rspec/core/command_line.rb:22:in `run'
from /Users/Evan/.rvm/gems/ruby-1.9.3-p392/gems/rspec-core-2.13.1/lib/rspec/core/runner.rb:80:in `run'
from /Users/Evan/.rvm/gems/ruby-1.9.3-p392/gems/rspec-core-2.13.1/lib/rspec/core/runner.rb:17:in `block in autorun'
Regarding previous answers I found to this question: my attempts to alter the .bashrc just left me confused about what the heck I was doing, and I don't think I got the syntax right (also it didn't work).
Any thoughts? Much appreciated!
Evan
Rspec assumes your specs in a spec/ directory which cannot be found. Try running
rspec spec_tutorial
Btw. this tutorial is pretty outdated. Try using rspec.info instead for example.
I tried to run a heroku console for a Rails 3.2 app using
heroku run bundle exec rails console
a command which has previously worked. It gave me the error message below. I also tried to run
heroku info
and got a similar error message. I did this both before and after signing in with the heroku toolbelt, same result. I also tried this on another website and got the same result. Both websites are actually working, just can't access the console
Can anyone explain what the problem might be.
! Heroku client internal error.
Error: No such file or directory - git --version (Errno::ENOENT)
Backtrace: /usr/local/heroku/lib/heroku/helpers.rb:103:in ``'
/usr/local/heroku/lib/heroku/helpers.rb:103:in `has_git?'
/usr/local/heroku/lib/heroku/helpers.rb:108:in `git'
/usr/local/heroku/lib/heroku/command/base.rb:206:in `git_remotes'
/usr/local/heroku/lib/heroku/command/base.rb:179:in `extract_app_in_dir'
/usr/local/heroku/lib/heroku/command/base.rb:31:in `app'
/usr/local/heroku/lib/heroku/command/run.rb:108:in `block in run_attached'
/usr/local/heroku/lib/heroku/helpers.rb:236:in `action'
/usr/local/heroku/lib/heroku/command/run.rb:107:in `run_attached'
/usr/local/heroku/lib/heroku/command/run.rb:21:in `index'
/usr/local/heroku/lib/heroku/command.rb:206:in `run'
/usr/local/heroku/lib/heroku/cli.rb:28:in `start'
/usr/bin/heroku:24:in `<main>'
Command: heroku run bundle exec rails console
Version: heroku-toolbelt/2.33.2 (x86_64-darwin10.8.0) ruby/1.9.3
This problem resulted from the installation of Mountain Lion on my Mac. To fix it, I had to open XCode preferences and to install the command line tools in the downloads folder.
I'm a beginner on Ruby on Rails, Git and Heroku. I am following the Rails Tutorial behind a corporate proxy. So far I am able to install RailsInstaller that helped me set up Ruby, Rails, and Git (also GitHub) rather smoothly. But I am really stuck on the section (http://ruby.railstutorial.org/ruby-on-rails-tutorial-book#sec:1.4.1), where I am trying to link my public key to my new Heroku account to push the repository to Heroku.
I am on a Windows 7 box behind a corp proxy. I have my HTTP_PROXY env variable set up and it is working for my push to GitHub. I'm not able to get past the following error. It does not seem to get to the point of complaining about ssh public key and the other posts here about heroku keys:add errors have different output.. And I haven't located relevant info at help.heroku.com. Any insights would be greatly appreciated!
c:\Sites\testproj\thirdapp>heroku keys:add
Enter your Heroku credentials.
Email: my.email#gmail.com
Password (typing will be hidden):
! Heroku client internal error.
! Search for help at: https://help.heroku.com
! Or report a bug at: https://github.com/heroku/heroku/issues/new
Error: A non-blocking socket operation could not be completed immediately. (Excon::Errors::SocketError)
Backtrace: C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/openssl/buffering.rb:53:in `sysread'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/openssl/buffering.rb:53:in `sysread'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/openssl/buffering.rb:53:in `fill_rbuff'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/openssl/buffering.rb:293:in `eof?'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/openssl/buffering.rb:246:in `readline'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/excon-0.14.0/lib/excon/ssl_socket.rb:68:in `initialize'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/excon-0.14.0/lib/excon/connection.rb:330:in `new'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/excon-0.14.0/lib/excon/connection.rb:330:in `socket'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/excon-0.14.0/lib/excon/connection.rb:175:in `request_kernel'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/excon-0.14.0/lib/excon/connection.rb:101:in `request'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/heroku-api-0.2.5/lib/heroku/api.rb:60:in `request'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/heroku-api-0.2.5/lib/heroku/api/login.rb:9:in `post_login'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/heroku-2.27.1/lib/heroku/auth.rb:74:in `api_key'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/heroku-2.27.1/lib/heroku/auth.rb:183:in `ask_for_credentials'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/heroku-2.27.1/lib/heroku/auth.rb:214:in `ask_for_and_save_credentials'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/heroku-2.27.1/lib/heroku/auth.rb:78:in `get_credentials'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/heroku-2.27.1/lib/heroku/command/keys.rb:66:in `add'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/heroku-2.27.1/lib/heroku/command.rb:176:in `run'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/heroku-2.27.1/lib/heroku/cli.rb:10:in `start'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/heroku-2.27.1/bin/heroku:16:in `<top (required)>'
C:/RailsInstaller/Ruby1.9.3/bin/heroku:19:in `load'
C:/RailsInstaller/Ruby1.9.3/bin/heroku:19:in `<main>'
Command: heroku keys:add
Version: heroku-gem/2.27.1 (i386-mingw32) ruby/1.9.3
I am also getting the same error. I uninstall it and install the lattest version of Heroku from Toolbelt and get resolved....
A similar issue has been raised in:
https://github.com/heroku/heroku/issues/441
I'm also getting the same error when calling "heroku keys:add".
Unfortunately, still haven't found any workarounds when working behind proxies.
According to the issue, the command works when NOT behind a proxy.