How do you Install DNX on OSX using Homebrew? - asp.net-core

Hello Since the big rename of k to dnx I have no idea how to install the tools on my mac?
the documentation on the dev branch has not been updated to reflect the big rename
https://github.com/aspnet/Home/tree/dev

The homebrew-k was updated recently to support dnvm. Here the instructions:
Install Homebrew if it is not already installed.
Run command brew tap aspnet/k to tap the ASP.NET 5 related git repositories. If you had already tapped the repo for previous releases, run brew untap aspnet/k to delete the old commands and tap again to get the updated brew scripts
Run command brew install dnvm to install dnvm. This will automatically install the latest DNX package from https://www.nuget.org/api/v2 feed
Run command source dnvm.sh on your terminal if your terminal cannot understand dnvm
EDIT
Homebrew-K was renamed to Homebrew-dnx so now you should use
brew tap aspnet/dnx
If you tapped aspnet/k it is probably not a bad idea to untap it (brew untap aspnet/k) and update brew (brew update)

Related

how to update meson version in flatpak builder

I'm trying to work on a gnome project (Aisleriot). It requires meson, so I installed it using
sudo apt install meson
That installed version 0.61.2. Unfortunately, the project requires version >= 0.62.0. Next, I ran the following command:
sudo apt-get install python3 python3-pip python3-setuptools python3-wheel ninja-build
Now meson is at version 0.64.0. Unfortunately, when I run Builder
flatpak run org.gnome.Builder
and load my project, it still uses meson version 0.61.2. Why is it using this earlier version and how do I tell Builder to use the system version instead?
There is a similar question from 4 years ago, but it talks about a build settings panel, which I couldn't find. Does the build settings panel still exist and how do I display it?

brew install httpd return error MacOS 10.14 version

Im running this command
brew install php#8.0
Unfortunately i got this error
==> Installing php#8.0 dependency: httpd
Warning: A newer Command Line Tools release is available.
Update them from Software Update in System Preferences or run:
softwareupdate --all --install --force
If that doesn't show you any updates, run:
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install
Alternatively, manually download them from:
https://developer.apple.com/download/all/.
You should download the Command Line Tools for Xcode 11.3.1.
==> ./configure --enable-layout=Slackware-FHS --prefix=/usr/local/Cellar/httpd/2
==> make
==> make install
Do not report this issue to Homebrew/brew or Homebrew/core!
Error: You are using macOS 10.14.
We (and Apple) do not provide support for this old version.
You will encounter build failures with some formulae.
Please create pull requests instead of asking for help on Homebrew's GitHub,
Twitter or any other official channels. You are responsible for resolving
any issues you experience while you are running this
old version.
Is there any possible solution to handle it without upgrading MacOS version?

Shopify CLI seems unable to find Ruby on Mac

I installed shopify-cli using homebrew on my Mac and tried verifying the installation by running shopify version, but I get an error:
/usr/local/bin/shopify: line 2: /opt/homebrew/Cellar/ruby/3.0.1/bin/ruby: No such file or directory
Any idea what needs to be fixed?
Try running brew install ruby#3.0. It worked for me!
It appears that shopify-cli was installed when your Homebrew ruby was at version 3.0.1. This can be fixed by running the following command:
brew reinstall shopify-cli
(Ideally, the shopify-cli formula should be updated by its maintainers to replace hardcoded ruby paths to the version-agnostic /opt/homebrew/opt/ruby. Alternatively, they could track the Homebrew ruby version and bump the revision of shopify-cli whenever an update occurs. This will prompt end-users to run brew upgrade, which will automatically reinstall shopify-cli.)

How do I change the version of yarn used?

I used Homebrew to install yarn. Running yarn -v shows that I currently use 0.23.2. I ran brew upgrade yarn to get the latest version, which is 0.24.6.
After Homebrew successfully upgrades yarn, I run yarn -v again, but the version is still 0.23.2. How can I change the version of yarn that I am running?
yarn policies set-version <version number>
Per https://github.com/yarnpkg/yarn/issues/7146#issuecomment-477809216
You can use homebrew and yarn formula URLs to install older versions of yarn, then brew switch between yarn versions as needed. Works perfectly! Credit to github user robertmorgan.
First off, if you already have a version installed, unlink it from brew running the brew unlink yarn command in your terminal.
Next, in a web browser, find the Pull Request that has been merged which contained the formula (version) of
Yarn
that you want to install.
View the files changed in that Pull Request - there should be one for Formula/yarn.rb.
Click the "View" button for the Formula/yarn.rb file to see the whole contents of the file for that commit.
Click the button to view the "Raw" version of that file. This will open a url which should start with
https://raw.githubusercontent.com/....
This is the URL that you will need for the next step - so copy the complete URL to your clipboard.
Back in your terminal window, use the command brew install followed by the URL that you've copied.
e.g. to install v1.6.0 of yarn it would be:
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/fba7635ab69384ac980c635483a7af825bc06088/Formula/yarn.rb
You can then verify the versions available to Homebrew by running:
brew list --versions yarn, and switch between versions using brew switch yarn VERSION_NUMBER
Source: https://github.com/yarnpkg/yarn/issues/1882#issuecomment-421372892
I found an answer. It's not the prettiest, but since yarn always tell me what the most update-to-date version is, I can use npm to just install the latest version.
If the latest is 0.24.6
npm install --global yarn#.24.6
EDIT:
According to yarn's official documentation, the way to install/upgrade is:
brew install yarn
brew upgrade yarn
https://yarnpkg.com/en/docs/install#mac-stable
Your best bet would be to use a yarn version manager.
Install:
curl -fsSL https://raw.githubusercontent.com/tophat/yvm/master/scripts/install.sh | bash
Single usage:
yvm exec <version> <command>
Or to switch your currently running yarn version
yvm use <version>
yarn --version
UPDATE Dec 2021:
Sadly brew switch is deprecated in Homebrew 2.6.0 (December 2020)
$ brew switch
Error: Unknown command: switch
TLDR, to switch version:
brew unlink yarn
brew link yarn#<new_version>
Old solution:
Assuming that you have the other version installed, you can run
brew switch yarn <old_version>
To list the versions you have installed:
brew list --versions yarn
You can use
yarn set version <version>
For example, if you want the latest version, you can run
yarn set version latest
You can also set it to a specific number, for example,
yarn set version 1.22.1
You can view the full documentation at the official website.
Note 1: A bug stops you from switching from yarn 2 to yarn 1. There are solutions to this in this GitHub issue.
Note 2: I don't use brew, but this solution should still work.
Easily install and switch between any number of yarn versions.
https://github.com/tophat/yvm
Here's a way to do it with only curl and bash:
curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 0.24.6 # or another version
This works whether you have yarn installed or not.
For updating version on macOS use below command:
$ brew upgrade yarn
Some of the above answers don't seem to work anymore. Here is how I was able to install a different version in April 2021:
brew unlink yarn#1.6.0 (If you already have a version installed)
brew extract --version 1.22.4 yarn homebrew/cask
brew install yarn#1.22.4
yarn -v

OSX Error dnvm: command not found

I am newbie to OSX. After following the step by step instructions from https://github.com/aspnet/home.
brew tap aspnet/dnx
brew update
brew install dnvm
I got the following error when I run dnvm upgrade:
$ dnvm upgrade
Error:
-bash: dnvm: command not found
I have tried locate the dnvm and looks like it is successfully installed in the \usr\local directory.
Is there a step I am missing?
run source dnvm.sh after brew install dnvm and try to run dnvm then. Preferably, put this on your shell profile (e.g. inside .profile file) so that it will persist.
For this specific problem like the answer above mention just run source dnvm.sh
If you want to get up and running with asp.net 5 in OSX see how I fixed some problems on the way this blog post tutorial can help