OSX Error dnvm: command not found - asp.net-core

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

Related

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.)

Error while installing from script ZeroBraneStudio

When executing ZeroBraneStudioEduPack-1.70-linux.sh i get this error: xdg-desktop-menu: No writable system menu directory found.
It could be related to my desktop environment ? currently i'm using sway with xwayland.
According to this answer, seems to be an xdg bug. You can check if running sudo mkdir /usr/share/desktop-directories/ before running the install command fixes the issue. I'll consider adding it to the install script if it helps.

Laravel valet linked php error

I got an error.
$ valet install
[DomainException]
Unable to determine linked PHP.
install
'which' command returns:
$ which php
/usr/local/Cellar/php70/7.0.6/bin/php
I used Homebrew to instal php7.1 , So I ran this command in terminal
ln -s /usr/local/opt/php71/bin/php /usr/local/bin/php
and everything is done.
if your PHP version 7.x and valet > 2.0.8 update valet
valet stop
valet uninstall
brew install php
composer global require laravel/valet
then valet install
Homebrew creates (or attempts to create) symlinks in /usr/local/bin.
Start by running the following to attempt to create a link.
brew link php70
It'll give you information as to whether or not it was successful. Occasionally permissions are problematic and you can resolve this with
sudo chown -R `whoami`:admin /usr/local/bin
Then try running the brew link command again.
Alternately brew link may give you instructions, or you can use brew doctor to get a report on any problems which exist with your Homebrew installation.
When it's set up properly after running ls -la /usr/local/bin | grep bin/php$ you should see something similar to
lrwxr-xr-x 1 YOURUSER admin 29 10 May 21:40 php -> /usr/local/Cellar/php70/7.0.6/bin/php
I was going to update Laravel Valet from version 1.* to 2 and ran same error like this
Unable to determine linked PHP
The solution was to run
composer global update
before I ran
valet install
This happens when your brew php gets Updated.
If you do brew install php this will work but will install php 7.2 by default.
If you want php#7.1 you have to do brew install php#7.1 this will install php7.1 and now when you restart valet valet restart you might get an error. Unable to determine linked PHP.
To make this work with php7.1 you have make brew link
brew link php71
you may have this error
Warning: php#7.1 is keg-only and must be linked with
to fix this
brew link --force php71
now valet should work on php7.1
I tried all of the suggestions here—and several from elsewhere—before I hit on the solution. This applies to PHP 7.2 (no guarantee for other versions). If you are using the original Larvel Valet, open the file:
~/.composer/vendor/laravel/valet/cli/Valet/Brew.php
...or, if you're using Valet+
~/.composer/vendor/weprovide/valet-plus/cli/Valet/Brew.php
Locate the supportedPhpVersions method. In some versions, it will return an array right in the method:
return ['php72', 'php71', 'php70', 'php56'];
Change this to:
return ['7.2', 'php72', 'php71', 'php70', 'php56'];
In other cases, it'll reference const SUPPORTED_PHP_VERSIONS, and the change will be similar.
Save the file, restart valet, and Bob's your uncle!

How do you Install DNX on OSX using Homebrew?

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)

RubyODBC Cannot allocate SQLHENV

I'm trying to connect to SQL Server on Ubuntu 9.04 using Ruby. I translated and followed all the steps outlined in getting OSX talking to SQL Server from here:
http://toolmantim.com/articles/getting_rails_talking_to_sqlserver_on_osx_via_odbc
Everything is working on the FreeTDS and unixODBC end. I can see and query the database using tsql.
When I try to access the database from Ruby using IRB I get the following error:
DBI::DatabaseError : INTERN (0) [RubyODBC] Cannot allocate SQLHENV
Has anyone run into this and what can I do to solve this?
I started getting this error when I upgraded to Ubuntu 9.10 (Karmic Koala). Your tip regarding installation order of the Ubuntu packages didn't work for me.
It seems the fix was to manually compile ruby-odbc.
wget http://www.ch-werner.de/rubyodbc/ruby-odbc-0.9997.tar.gz
tar xzvf ruby-odbc-0.9997.tar.gz
cd ruby-odbc-0.9997
ruby extconf.rb --with-dlopen
make
sudo make install
System
Ubuntu 9.10 64 bit
I had to specify the odbc directory in the rubyodbc install
wget http://www.ch-werner.de/rubyodbc/ruby-odbc-0.9997.tar.gz
tar xzvf ruby-odbc-0.9997.tar.gz
cd ruby-odbc-0.9997
ruby extconf.rb --with-odbc-dir=/usr/lib/odbc --disable-dlopen
make
sudo make install
I had the same problem.
But on Centos 5.5 not Ubuntu
Tried many forums/solutions with no joy.
The error message hints at a missing reference to unixODBC.
Which was setting using LD_LIBRARY_PATH variable.
Found another way to set path, by creating
/etc/ld.so.conf.d/odbc.conf.
add unixODBC location to file ie /usr/local/lib.
Run, sudo ldconfig.
Go fig that I actually got this working after submitting my question. What I ended up doing was uninstall libdbd-odbc-ruby and libdbi-ruby and then reinstalling them by installing libdbi-ruby first and then installing libdbd-odbc-ruby. I guess when I installed them before, something must of messed up.
BTW, following the instructions to recompile Ruby-ODBC on Ubuntu 9.10 (Karmic) required installation of either the libiodbc2-dev or the unixodbc-dev package. When using libiodbc2-dev, I got segmentation faults when my Ruby program tried:
connection.select_all('select top 15 * from log_device_healths')
..but no problem when using unixodbc-dev instead.
Tim Morgan's solution didn't work for me. However I was able to get things working by installing an older version of libodbc-ruby (0.9995) from here:
http://mirrors.kernel.org/ubuntu/pool/universe/libo/libodbc-ruby/libodbc-ruby1.8_0.9995-1_i386.deb
Additional details are available from Carsten Gehling's blog:
http://gehling.dk/2010/02/the-woes-of-libodbc-ruby1-8-and-debian-ubuntu/
Be careful though -- Ubuntu's Update Manager will happily "upgrade" this version of libodbc-ruby to the broken 0.9997-2. I accidentally overwrote the older version this way only to end up back here, trying to figure out how I fixed it last time.
Well, it seems my other answer stopped working for me. This thread helped me to solve the issue in another way, and I wanted to share it here.
sudo gem uninstall ruby-odbc
sudo rm /usr/local/lib/site_ruby/1.8/x86_64-linux/odbc.so
cd /tmp
wget http://mirrors.kernel.org/ubuntu/pool/universe/libo/libodbc-ruby/libodbc-ruby1.8_0.9995-1_amd64.deb
sudo dpkg -i libodbc-ruby1.8_0.9995-1_amd64.deb
If you're not on a 64-bit platform, you'll need to download a different Debian package.
Basically, what solves the problem is installing version 0.9995 of the ruby-odbc Ubuntu package.