Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"travis login --pro" -> no implicit conversion of nil into String #586

Open
smbrd opened this issue Mar 2, 2018 · 15 comments
Open

"travis login --pro" -> no implicit conversion of nil into String #586

smbrd opened this issue Mar 2, 2018 · 15 comments

Comments

@smbrd
Copy link

smbrd commented Mar 2, 2018

$ travis login --pro --auto
We need your GitHub login to identify you.
This information will not be sent to Travis CI, only to api.github.com.
The password will not be displayed.

Try running with --github-token or --auto if you don't want to enter your password anyway.

Username: smbrd
Password for smbrd: **************
no implicit conversion of nil into String
for a full error report, run travis report --pro
[~/code/branded]
$ travis report --pro
System
Ruby: Ruby 2.0.0-p648
Operating System: Mac OS X 10.12.6
RubyGems: RubyGems 2.7.6

CLI
Version: 1.8.8
Plugins: none
Auto-Completion: yes
Last Version Check: 2018-03-02 16:49:48 +0100

Session
API Endpoint: https://api.travis-ci.com/
Logged In: as "smbrd"
Verify SSL: yes
Enterprise: no

Endpoints
pro: https://api.travis-ci.com/ (access token, current)
org: https://api.travis-ci.org/ (access token)

Last Exception
An error occurred running travis login --pro:
TypeError: no implicit conversion of nil into String
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/json/common.rb:155:in initialize' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/json/common.rb:155:in new'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/json/common.rb:155:in parse' from /Library/Ruby/Gems/2.0.0/gems/travis-1.8.8/lib/travis/tools/github.rb:262:in gh_error'
from /Library/Ruby/Gems/2.0.0/gems/travis-1.8.8/lib/travis/tools/github.rb:211:in rescue in basic_auth' from /Library/Ruby/Gems/2.0.0/gems/travis-1.8.8/lib/travis/tools/github.rb:208:in basic_auth'
from /Library/Ruby/Gems/2.0.0/gems/travis-1.8.8/lib/travis/tools/github.rb:215:in login' from /Library/Ruby/Gems/2.0.0/gems/travis-1.8.8/lib/travis/tools/github.rb:80:in possible_tokens'
from /Library/Ruby/Gems/2.0.0/gems/travis-1.8.8/lib/travis/tools/github.rb:49:in each_token' from /Library/Ruby/Gems/2.0.0/gems/travis-1.8.8/lib/travis/tools/github.rb:36:in with_token'
from /Library/Ruby/Gems/2.0.0/gems/travis-1.8.8/lib/travis/cli/login.rb:31:in login' from /Library/Ruby/Gems/2.0.0/gems/travis-1.8.8/lib/travis/cli/login.rb:40:in run'
from /Library/Ruby/Gems/2.0.0/gems/travis-1.8.8/lib/travis/cli/command.rb:198:in execute' from /Library/Ruby/Gems/2.0.0/gems/travis-1.8.8/lib/travis/cli.rb:64:in run'
from /Library/Ruby/Gems/2.0.0/gems/travis-1.8.8/bin/travis:18:in <top (required)>' from /usr/local/bin/travis:23:in load'
from /usr/local/bin/travis:23:in `

'

@astromechza
Copy link

astromechza commented Mar 10, 2018

Similar issue with some workarounds that have worked for other people here: #190. Seems like the main fix is using a newer version of ruby.

@purplediane
Copy link

It appears to me that sometimes the Travis commands are using an old version of ruby. I have 2.5.0p0 (from ruby --version), but when I used brew install travis, the commands were using Ruby 2.0.0-p648 (that's what the travis report said, just like above). My solution was to brew uninstall travis and then gem install travis -v 1.8.8 --no-rdoc --no-ri per instructions here: https://github.com/travis-ci/travis.rb#installation. But if you look at #190, you will see some people fixed the problem with brew install travis. And others were having firewall issues. Go figure.

@smbrd
Copy link
Author

smbrd commented Mar 12, 2018 via email

@weaming
Copy link

weaming commented Mar 25, 2018

Same issue when travis login

And

$ travis version
dyld: lazy symbol binding failed: Symbol not found: _ffi_closure_alloc
  Referenced from: /usr/local/lib/ruby/gems/2.5.0/gems/ffi-1.9.23/lib/ffi_c.bundle
  Expected in: flat namespace

dyld: Symbol not found: _ffi_closure_alloc
  Referenced from: /usr/local/lib/ruby/gems/2.5.0/gems/ffi-1.9.23/lib/ffi_c.bundle
  Expected in: flat namespace

[1]    59554 abort      travis version

@martijnthe
Copy link

Just hit this as well and wasted a half an hour on this.
Getting a newer ruby and re-installing the travis gem "fixed" things.
Kind of disappointing travis' CLI tool doesn't work with the ruby 2.0.0 that ships with macOS (I'm not a ruby dev so I haven't bothered updating it) or at least warns me with a message saying the ruby is too old or something.

@salunn
Copy link

salunn commented Apr 5, 2018

Possible workaround is to copy your API token from the web UI, and paste it to your ~/.travis/config.yaml. After this you're able to login and (as far as I can tell) use the Travis CLI.

@neekey
Copy link

neekey commented Apr 7, 2018

same issue here

@kpepper
Copy link

kpepper commented Apr 17, 2018

Once you've upgraded Ruby (e.g. to 2.5.1p57), then run "sudo gem install travis -v 1.8.8 --no-rdoc --no-ri". If you're behind a proxy you will need to add the --http-proxy url:port argument to the gem install command.

@tylerwray
Copy link

Had the same problem. Fixed It for me after I installed the development version of the travis CLI.

gem install travis --pre

@antwal
Copy link

antwal commented Jun 3, 2018

today same issue on login, not working --pro, normal password or github-token.

@alan-ma-umg
Copy link

same issue here. what's the fix?

@smbrd
Copy link
Author

smbrd commented Jun 14, 2018 via email

@alan-ma-umg
Copy link

thanks @smbrd . Here are my steps to fix the issue:

$ sudo gem uninstall travis
$ brew install ruby
$ ruby -v
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin16]
$ sudo gem install travis  --no-rdoc --no-ri
$ sudo travis version
1.8.8

@naviud
Copy link

naviud commented Sep 20, 2018

Thanks @alan-ma-umg . That works perfectly

@b23prodtm
Copy link

b23prodtm commented Dec 8, 2018

I needed to link ruby and prepend to $PATH profile

$ echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profile
$ ruby -v

ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin13]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests