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

OSX install guide missing important step of sourcing .sh file #499

Closed
cschneid opened this issue Apr 29, 2015 · 23 comments
Closed

OSX install guide missing important step of sourcing .sh file #499

cschneid opened this issue Apr 29, 2015 · 23 comments

Comments

@cschneid
Copy link

brew install dnvm places a shell script that needs to be sourced.

I am using zsh, and the script is entirely silent when run. Only after actually opening up dnvm.sh did I realize that it was a bag of functions that needed to be sourced.

Solutions:

  1. Update README to note this
  2. Have the script output something if it was run, rather than sourced.
@jrock2004
Copy link

What do you need to add? the path the dvm.sh file itself?

@jedgrant
Copy link

I'm hoping this is related...
I attempted to follow the OS X installation guidelines. Entering dnvm update results in a -bash: dnvm: command not found message. Is there a step that I am missing?

I did...
brew tap aspnet/dnx
brew update
brew install dnvm

Those commands were successful.

@miguellira
Copy link

@jedgrant make sure you add source dnvm.sh to your ~/.bash_profile.

Keep in mind, however, that if you've tapped the latest version of Mono (4.0.1) you will run into my issue. See #498

@davidcv5
Copy link

After running brew and adding source dnvm.sh to ~/.zshrc, I still can't run dnu restore.
dnvm runs just fine.. but doing dnvm upgrade returns the following:

Determining latest version
Error: Could not find latest version from feed https://nuget.org/api/v2

Any clue?

@miguellira
Copy link

@davidcv5 Make sure your NuGet feed is configured to the latest vNext feed, specifically https://www.myget.org/F/aspnetvnext/api/v2. On Mac OS X this is located in: ~/.config/NuGet/NuGet.Config

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="AspNetVNext" value="https://www.myget.org/F/aspnetvnext/api/v2" />
    <add key="NuGet.org" value="https://nuget.org/api/v2/" />
  </packageSources>
</configuration>

@jrock2004
Copy link

dnvm upgrade -u

@davidcv5
Copy link

wow... that was fast!!! Thanks a lot @miguellira and @jrock2004

I tired @jrock2004 solution which was shorter and it worked prefect!!

Thanks a lot!

@miguellira
Copy link

np @davidcv5 Do you mind executing mono --version and letting me know what version of Mono you are running against?

@davidcv5
Copy link

@miguellira .. I'm running 4.0.1

@jedgrant
Copy link

@miguellira please pardon my lack of experience, how do I add that? nano .bash_profile I assume? But what should the string look like? Currently it is export PATH="~/npm-global/bin:$PATH" does it just need to change like... export PATH="~/npm-global/bin:source dnvm.sh:$PATH"?

@davidcv5
Copy link

@jedgrant you can just add it as a new line.
so your .bash_profile will look like this...

export PATH="~/npm-global/bin:$PATH"
source dnvm.sh

@jedgrant
Copy link

Fantastic, thank you!

@TomSchillemans
Copy link

I've added the source dmvm.sh to my ~/.zshrc and run @jrock2004's line and it all works perfectly now!! So basically this needs to be mentioned in the README and it all is fine and dandy.

@chemitaxis
Copy link

I have done all in this post, but I still have the same problem... using dnvm upgrade and dnvm upgrade -u and dnvm upgrade -f (force).

Error: Could not find latest version from feed https://nuget.org/api/v2

But have the same problem.. maybe something wrong adding to my ~/.zshrc, what is the correct way please?

Thanks!!

@davidcv5
Copy link

@chemitaxis If you get that message that means the dnvm command was found, so your .zshrc file should be fine..
Using dnvm upgrade -u worked perfect for me, but if yours is still trying to pull from https://nuget.org/api/v2, I would suggest setting your NuGet config file as previously suggested by miguellira.

@chemitaxis
Copy link

HI @davidcv5, I have done all, changed the ~/.config/NuGet/NuGet.Config that just had this

<?xml version="1.0" encoding="utf-8"?> <configuration> </configuration>

Adding that, but no way...

<?xml version="1.0" encoding="utf-8"?> <configuration> <packageSources> <add key="AspNetVNext" value="https://www.myget.org/F/aspnetvnext/api/v2" /> <add key="NuGet.org" value="https://nuget.org/api/v2/" /> </packageSources> </configuration>

I don't know what I did bad...

@misterzik
Copy link

would it be okay, if i only add it to one of the following three files? or does it have to be in all of them?
~/.bash_profile, ~/.bashrc or ~/.zshrc

source dnvm.sh

Best Regards

@miguellira
Copy link

@misterzik it all depends on the shell you're using. This page sums up your options: .bash_profile vs .bashrc

Basically, if you use Terminal on Mac OS X you may want to add this to your ~/.bash_profile

if [ -f ~/.bashrc ]; then
   source ~/.bashrc
fi

and this in your ~/.bashrc

source dnvm.sh

@misterzik
Copy link

@miguellira Thanks Miguel, I actually did something bit different and it seems to be working for now, but incase it stops working, I'll make sure to redirect to this page.

I used this on my ~/.bashrc ;

echo "source dnvm.sh" >> ~/.bashrc

then restarted it my terminal and was working just fine, but thanks anyways for taking your time to respond. Cheers

@joeblew99
Copy link

Hey, i have same issue and so wrote a test .sh script-

tool-init-env.1.sh

#!/bin/bash

source $PWD/tool-init-env.2.sh

source $HOME/workspace/go/src/bitbucket.org/apparently_different/backend/tool-init-env.2.sh

echo "YOUR PATH:"
echo $PATH

tool-init-env.2.sh

#!/bin/bash

export PATH=$PATH:/User/blahblahblahblahblah

Now check what happens when its run:

gedw99-MacBook-Pro:backend apple$ ./tool-init-env.1.sh 
YOUR PATH:
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/usr/local/go/bin:/Users/apple/workspace/go/bin:/User/blahblahblahblahblah:/User/blahblahblahblahblah
gedw99-MacBook-Pro:backend apple$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/usr/local/go/bin:/Users/apple/workspace/go/bin
gedw99-MacBook-Pro:backend apple$ 

So whats happening ?

when script 1 does it thing and then echos the $PATH, it has the new path

But straight after, when you do a echo $PATH in terminal the new path is gone.

On Linux it behaves the same too:

vagrant@vagrant-ubuntu-trusty-64:~$ ./1.sh
YOUR PATH:
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/User/blahblahblahblahblah
vagrant@vagrant-ubuntu-trusty-64:~$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
vagrant@vagrant-ubuntu-trusty-64:~$ 

@miguellira
Copy link

@joeblew99 Try using source to execute the script commands in the current shell.

Instead of:

gedw99-MacBook-Pro:backend apple$ ./tool-init-env.1.sh 

try

gedw99-MacBook-Pro:backend apple$ source tool-init-env.1.sh 

But really, now that https://get.asp.net/ is live, getting the appropriate package for your given OS is probably the best way to get started. Just be prepared to start all over again once donet cli is official: http://www.hanselman.com/blog/ExploringTheNewNETDotnetCommandLineInterfaceCLI.aspx

@joeblew99
Copy link

Hey @mig.

Yes I am aware that from the terminal directly it does work. But I actually want to be able to call a .sh that has the ability inside the script to set the path mappings for the duration if that bash session.

It much easier for the team to use is the reason. And I just want to know how its done :)

@aspnet-hello
Copy link

This issue is being closed because it has not been updated in 3 months.

We apologize if this causes any inconvenience. We ask that if you are still encountering this issue, please log a new issue with updated information and we will investigate.

jkotalik added a commit that referenced this issue Nov 1, 2018
ryanbrandenburg pushed a commit that referenced this issue Nov 20, 2018
natemcmaster pushed a commit that referenced this issue Nov 20, 2018
This commits also gets rid of the name
closure in FormFileCollection by interating
over the files in the collection instead
of using Find and FindAll.

Closes #352 and #499
ryanbrandenburg pushed a commit that referenced this issue Nov 22, 2018
natemcmaster pushed a commit that referenced this issue Dec 1, 2018
Add AppVeyor, Travis build status
@ghost ghost locked as resolved and limited conversation to collaborators Dec 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants