Comments (14)
Maybe try the gem version of gist, via gem install gist
? At least then you can try loading up the gist library in IRB and use it to see what's going on.
from gist.
Not sure how to do it. But the gem version outputted "nil" as well.
Oh well, copy & paste works as well ;)
from gist.
I'm sorry you're having trouble -- I don't really have any ideas. It works just fine for me both standalone and as a gem.
from gist.
I would really love to know how I can debug this. Not fluent with Ruby at all. And I'm not sure how to utilize the gem.
from gist.
okay, here's how to manually use the gem:
$ gem install gist
Successfully installed gist-2.0.2
1 gem installed
$ irb
>> require 'gist'
=> true
>> Gist.write [:input => "testing"], true
=> "https://gist.github.com/e6586a128773f71e47e8"
from gist.
Thank you so much!
But, yet nil
is still displayed. No error message at all.
Oh well, I don't want to take more of your time :) Thank for the help. Much appreciated ;)
from gist.
Very strange. That means that, somehow, the HTTP request to gist.github.com is completing without an error, but the response is not including a "Location" header. I take it the gist that you are trying to create is not actually showing up at gist.github.com?
from gist.
Okay, this is really bugging me. So here is an example of manually putting through a request to the gist server, using the gist gem to set up the data for the request. When you do this, if you copy and paste the response to return to me, please X out the "token" value, and the "_gh_sess" value (like I did below) so that they can't be used to steal your github account.
$ irb
>> require 'gist'
=> true
>> irb Gist
>> url = URI.parse(CREATE_URL)
=> #<URI::HTTPS:0x103293840 URL:https://gist.github.com/gists>
>> if PROXY_HOST
>> proxy = Net::HTTP::Proxy(PROXY_HOST, PROXY_PORT)
>> http = proxy.new(url.host, url.port)
>> else
?> http = Net::HTTP.new(url.host, url.port)
>> end
=> #<Net::HTTP gist.github.com:443 open=false>
>> http.use_ssl = true
=> true
>> http.verify_mode = OpenSSL::SSL::VERIFY_PEER
=> 1
>> http.cert = OpenSSL::X509::Certificate.new(ca_cert)
=> #<OpenSSL::X509::Certificate subject=/C=US/O=RSA Data Security, Inc./OU=Secure Server Certification Authority, issuer=/C=US/O=RSA Data Security, Inc./OU=Secure Server Certification Authority, serial=3558802160848854062232407011527417280, not_before=Wed Nov 09 00:00:00 UTC 1994, not_after=Thu Jan 07 23:59:59 UTC 2010>
>> req = Net::HTTP::Post.new(url.path)
=> #<Net::HTTP::Post POST>
>> req.form_data = data([:input => "testing"], true)
=> {"file_contents[gistfile1]"=>"testing", "file_ext[gistfile1]"=>".txt", "file_name[gistfile1]"=>nil, :token=>"xxxx", "action_button"=>"private", :login=>"indirect"}
>> response = http.start{|h| h.request(req) }
=> #<Net::HTTPFound 302 Found readbody=true>
>> response["Location"]
=> "https://gist.github.com/5a821a0efed442100453"
>> response.each_header{}
=> {"strict-transport-security"=>["max-age=2592000"], "location"=>["https://gist.github.com/5a821a0efed442100453"], "connection"=>["keep-alive"], "content-type"=>["text/html; charset=utf-8"], "x-runtime"=>["312ms"], "date"=>["Tue, 12 Apr 2011 17:43:53 GMT"], "server"=>["nginx/0.7.67"], "content-length"=>["110"], "set-cookie"=>["_gh_sess=xxxx; path=/; expires=Fri, 01 Jan 2021 00:00:00 GMT; secure; HttpOnly"], "cache-control"=>["no-cache"], "status"=>["302 Found"]}
from gist.
Using the latest commit, I where able to track down the problem to be my token were wrong :) Since I had changed my password a while back.
Thank you :)
However, when I gisted my .vimrc
file it, I had the strange error Creating gist failed: 302 "Found"
, yet the Gist were created.
from gist.
Ah! Good catch... 302 found actually means the gist worked! Sounds like the patch I pulled doesn't handle that case correctly. :) Thanks!
from gist.
Fixed in 284dd9b.
from gist.
How come I don't see the commit, nor can pull it?
from gist.
Because I'm silly, and pushed to my fork but not the main repo :) Fixed now!
from gist.
Thank you :)
from gist.
Related Issues (20)
- One test failure in Ubuntu on all architectures HOT 3
- Can't establish creds HOT 2
- Feature: Support uploading a complete directory / existing repo with "gist ." or "gist somedir"
- Feature: Limit number of Gists returned with `-l` flag
- Feature: Allow specifying a directory name
- Bug: Gist title and filenames not fetched for some Gists
- texrt
- Feature: Option to show SSH url for cloning a Gist
- For security propose i thin it's better to make private "-p or --private" parameter as default HOT 1
- > Hello @defunkt o/ HOT 4
- Please enable device flow HOT 2
- Terraform plan and strange gibberish at every line start HOT 2
- clipboard interaction issue on windows (has solution)
- > Hello @default
- [feat] avoid unchanged revisions
- Received this error trying to login
- Your token. // Octokit.js // https://github.com/octokit/core.js#readme const octokit = new Octokit({ auth: 'YOUR-TOKEN' }) await octokit.request('DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}', { owner: 'OWNER', repo: 'REPO', environment_name: 'ENVIRONMENT_NAME', branch_policy_id: 'BRANCH_POLICY_ID', headers: { 'X-GitHub-Api-Version': '2022-11-28' } })
- ![スクリーンショット 2022-04-07 10 04 42](https://user-images.githubusercontent.com/8407272/162099822-637d0cc1-e1d7-495f-a44f-2fc0ab9f5a4f.png) HOT 1
- hdj HOT 1
- he
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gist.