dart pub package upload user? - dart

I've recently started using a new development machine and when I try to upload my pub package it fails saying "You aren't an uploader for package '\name\'." I've had a look on the pub site but haven't found away for me to find out A) who it thinks I am and B) how to give my current user access.

What is the package name?
You can take a look at the command pub uploader to modify your local uploader settings.

Related

How do I log out from Dart's pub package manager?

I have uploaded packages to pub.dartlang.org under two different accounts (one of them work-related, the other personal).
The pub command line tool doesn't have any option to select with which account to publish, so once I log on with the tool, and try to upload a package that belongs to the other account, I see:
$ pub publish
UnauthorizedAccess: Unauthorized user: ___#example.com is not allowed to upload versions to package xyz..
How do I publish with a specific account? Failing that, how do I log out the pub tool in order to log on again under a different account?
There is currently no way in the command line pub tool to upload under different credentials (although there is a proposal).
If you have a fairly recent version of pub, you can log out with:
$ pub logout
Then try pub publish again. The tool will ask you for new credentials.
Could not find a command named "logout".
The pub logout command is an addition from January 2019. If pub tells you this command doesn't exist, you'll have to manually remove the credentials file.
$ rm ~/.pub-cache/credentials.json
If you want to temporarily publish with different credentials you can use a command like:
PUB_CACHE=~/.other_credentials_cache pub publish
This will create a entirely separate "profile" which is used whenever running any pub command with the PUB_CACHE environment variable pointing to a directory other than ~/.pub_cache. If you were to pub get with this cache you'd get entirely separate package downloaded.
With this approach you can toggle between credentials by specifying or not specifying the different cache directory. You'll need to authenticate the first time you use the new directory.

Changing uploader for Flutter/Dart on same machine

I created package and uploaded via an account. i.e. uploader#outlook.com. I did not want to upload via this email address so I did:
pub uploader add new_uploader#outlook.com
Then I did
pub uploader remove uploader#outlook.com
The package displays correctly new_uploader#outlook.com now but I cannot figure out when I need to do a publish to use the new_uploader#outlook.com account. When I try:
flutter packages pub publish
It gives me this error:
UnauthorizedAccess: Unauthorized user: uploader#outlook.com is not allowed to upload versions to package flutter_platform_widgets.
pub finished with exit code 1
How do I tell flutter cli or the pub cli to use new_uploader#outlook.com and not uploader#outlook.com.
Both are google authorised accounts.
Also trying to do:
pub uploader add uploader#outlook.com
Gives an Unauthorized error.
Note: email addresses are not real, just for the purpose of the post
I did find the following as suggested by https://github.com/dart-lang/sdk/issues/14055
Delete the credential file:
.pub_cache/credentials.json
After doing this it asked for reauthentication which I used the new email address. I successfully uploaded the package with that email address.
Problem solved for me

Xcode CI and cocoapods private repo

I've been trying to setup OSX server to use Xcode CI. My project uses cocoapods and a private repo. I've been following this tutorial: http://papaanton.com/setting-up-xcode-6-and-apple-server-4-0-for-continues-integration-with-cocoapods/
But when I login as the _xcsbuildd user and run the command to add the private repo I get the following error message
fatal: could not create work tree dir '<repo name>': permission denied
I don't have much experience with users and command line tools. I've seen many comments online saying people need to change permissions to get it to work. But I have no idea what I need to change and where.
Can anyone tell me where / what / how I need to modify to give this user access to complete this process.
Just found the answer. Had no idea where cocoapods was storing these repos. I opened finder. Cmd + shift + g
typed in ~/.cocoapods/repos
right click on the repos folder and give "everyone" read & write access to the folder. All good now, CI working completely

Rspec errors in Rails app using Nitrous.io - 'cannot open shared object file'

When I run bundle exec rspec spec/ I get the following messages in the console:
Could not open library 'libgtkmm-2.4': libgtkmm-2.4: cannot open shared object file: No such file or directory.
Could not open library 'libgtkmm-2.4.so': libgtkmm-2.4.so: cannot open shared object file: No such file or directory.
Could not open library 'libgtkmm-2.4.so.1': libgtkmm-2.4.so.1: cannot open shared object file: No such file or directory.
Could not open library 'libgtkmm-3.0': libgtkmm-3.0: cannot open shared object file: No such file or directory.
Could not open library 'libgtkmm-3.0.so': libgtkmm-3.0.so: cannot open shared object file: No such file or directory.
Could not open library 'libgtkmm-3.0.so.1': libgtkmm-3.0.so.1: cannot open shared object file: No such file or directory
But, all of the tests pass and my app works just fine. Can anyone fill me in on what may have happened? Should I just scrap this box and clone my repo into a fresh one? I'm using Ruby 2.0.0p247 and Rails 4.0.2 in a Nitrous.io box. Thanks.
Even though unrelated (thank google for finding this), I have been trying to install Nitrogen for Ubuntu today. I get the same error. Seems like a specific GTK library has gone missing recently from either your system or your distro's repository (if you're even using Linux).
If you're using a Linux system, install the libgtkmm packages and if you're lucky enough, your missing library will be in one of those.
Use in Ubuntu this to install all of them:
sudo apt-get install libgtkmm*
Hope this helps.

Transferring a dart library to another owner in pub.dartlang.org

Since pub uses my identity for the publish, how would I go about transferring control to someone else, yet still allow them to publish releases to the same project? Maybe this is trivial; I've never tried it.
You can use pub uploader [options] {add/remove} <email>.
Once the new uploader added, you can remove yourself.
pub uploader add <new-owner-email>
pub uploader remove <old-owner-email>
$ pub uploader -h
Manage uploaders for a package on pub.dartlang.org.
Usage: pub uploader [options] {add/remove} <email>
-h, --help Print usage information for this command.
--server The package server on which the package is hosted.
(defaults to "https://pub.dartlang.org")
--package The package whose uploaders will be modified.
(defaults to the current package)
Update: It is now possible to invite new uploaders using the admin tab on the package page on pub.dev website.

Resources