Mix ecto.create: permission denied

i tyoed the below command as was given

 if [ -f ~/.asdf/asdf.sh ]; then
 . $HOME/.asdf/asdf.sh  
 fi

I also typed them seperately, one after another, but the same outcome.

As I said, you need to add those lines to your ~/.bashrc or whatever other file your shell reads for configuration.

And as I said, they will only work if you cloned asdf to exactly the location ~/.asdf.

What brought me to this point is that anytime i try to run the command

 iex(1)> string.reverse "madamimadam"

i get this error msg

 ** (CompileError) iex:1: undefined function string/0

Pls sir i dont understand at all what you mean

Again, the module name is String with a capital S.

I really dont mind if there is a way u can remote login into my mac


Then please tell how you have installed asdf, and to which location. And what shell you use on which operating system.

If we know all of these then we can perhaps help you to finish the installation of asdf.

Tmate.io helps with doing such SSH based remote support, though I do not have the time currently. I’m only on my mobile commuting to the office, and there I have a pile of work waiting for me, as finally I got access to the clients staging system I’m waiting for for “only” 3 months


Below was HOW i installed asdf:

"You’ll need asdf itself, found here: https://asdf-vm.com/#/core-manage-asdf-vm
And then the erlang plugin. Be sure to note the OS X instructions in the readme.
https://github.com/asdf-vm/asdf-erlang

And lastly the Elixir plugin https://github.com/asdf-vm/asdf-elixir"

OPERATING SYSTEM:

macOS Sierra
version:10.12.6 (16G29)

SHELL:
terminal (hope this is what you mean)

LOCATION:
destination path ‘/Users/macbook/.asdf’

Ok
 thanks.
I wish u the best at work!

Nope, that’s not what I mean.

I’m talking about your actual shell, not your terminal emulation software. Bash, zsh, fish, whatever?

The output of echo $SHELL might give some hints.

SHELL:

bin/bash

So it is “bash” then.

The minimal addition you need to do to your ~/.bash_profile (it seems as if bash on macOS favors that over the more common ~/.bashrc) is this line:

. $HOME/.asdf/asdf.sh

Though when the file is not available, your bash will barf at you, thats why I wrapped it in an if originally.

This is described on the installation page you linked: https://asdf-vm.com/#/core-manage-asdf-vm?id=add-to-your-shell

It even has nice dropdowns today, which let you pick some options to get the correct description for your environment.

To actually edit that file, just open it in your favorite editor. You might need to enable “show hidden files” in its file open dialog.

At this juncture, i will patiently wait for when u will be free enough so that you can remote login.

all i want to do is to start learning elixir, i am excited about learning it and don’t want this installation to demoralise me.

Just let me know when u will be free enough.

Thanks for the assist

I sadly don’t know when this pile of work will be small enough to plan for an hour of time in-between.

At home I won’t be able to help either, as family comes first, especially as we are preparing for a long weekend.

I’m pretty sure there are a lot more people available could help you out.

People who might even use macOS their self and therefore might know exactly what to do.

Ok
 no problem.

Not too many people i know here use mac, windows is most common, the the few i know use it for basic office or domestic work and not for core IT works.
Either way, I will see what i can do or alternatively i will just use a windows pc, since i have been using that for like forever. I have only started using mac for a few months and that is because i want to understand it as much as i do windows and learn to work with it equally well.

Once again, thanks for your assist.

How about i change the bash to any of

sh
zsh
ksh
tcsh or
csh

and then reinstall either using homebrew or asdf. Do you think that will solve the problem?

You shouldn’t change your shell, unless you understand the consequences.

Just follow all the steps from the installation page for asdf.

It’s just a git clone which it seems you have already done, and editing a file. Copying a single line into a text file.

It might be easy as running the following in a terminal:

cat <<EOF >> ~/.bash_profile

# load asdf
. ~/.asdf/asdf.sh
EOF

Though this is typed on a mobile during a coffee breakit might contain typos.

Before running it make sure to backup your ~/.bash_profile

Hi @SimplyEl, welcome to Elixir :slight_smile: Here are my 2 cents:

The reason you are way down in the rabbit hole is that you are basically setting up an entire development environment from scratch. Many of the things you’re dealing with have nothing to do with Elixir. You don’t need someone to remote into your machine, what you need is to break it down into steps.

  1. Choose a shell. Bash is a nice default, but many developers on macOS use ZSH, so that they can take advantage of Oh My Zsh features, plugins, and themes. I expect there are lovers of many other shells on this forum—it’s a personal thing.

  2. Create a basic configuration file for that type of shell. Each shell is unique, but there are certain features in common. One of those features is that you will need to define some variables that tell your shell where to find things (like commands and manuals). This is why your current shell can’t find things that you have installed.

  3. Choose how you want to install things, like command line tools and programming languages. In the end, you won’t install everything the same way, but at the beginning you need a nice default. For most macOS users, that’s Homebrew, which I believe you’ve already installed. I agree that asdf is a great way to manage different versions of Elixir (I use it myself), but I think Homebrew is much more plug and play if you are new to this. I used Homebrew Elixir for quite a while before switching to asdf.

  4. Each time you install something new, read the documentation, and add appropriate lines to your configuration file to make it work. Each thing you install will be different, and it’s not uncommon that they have some unique requirement about what to put in that file.

So if you came to me and said “I’m a complete beginner, I just want to get Elixir working on macOS so I can learn.” I would hold off on asdf (you can switch later) and do the following:

# install Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

# change permissions on the Cellar
sudo chown -R your_username /usr/local/Cellar

# install Homebrew Zsh (more up to date)
brew install zsh

# install Oh My Zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

# change your default shell to Zsh
chsh -s $(which zsh)

# switch to Zsh in the current shell
zsh

# install Elixir and dependencies
brew install Elixir

# edit your Zsh configuration file (Oh My Zsh installation script should create this, and add basic Oh My Zsh configuration
open ~/.zshrc

Many people will edit the variables in their .zshrc from the command line. But I think initially it’s good to open it and see what’s in there, so you understand later what happens when you edit the variables. There are an almost infinite number of things you can add to a .zshrc, but for now you just want to make sure your shell can find Elixir and other things you brew install. You might also want to make sure you can find documentation. So the two variables you’re going to edit are PATH and MANPATH, which will already exist if you have installed Oh My Zsh. The order of the paths in these variables matters, because the computer goes through them in order. If you want to make sure the computer uses a particular version of something, put that path at the top (for example, if you have Python installed by the operating system, but you also use your own version via Homebrew).

Edit PATH and MANPATH so they include at least the following (other things are ok):

export PATH="\
/usr/local/bin:\
/usr/local/sbin:\
/bin:\
/sbin:\
/usr/bin:\
/usr/sbin:\
$PATH"

export MANPATH="\
/usr/local/man:\
/usr/local/opt/erlang/lib/erlang/man:\
/usr/local/share/man:\
/usr/share/man:\
$MANPATH"

Then go back to your shell and source the configuration file to get a prompt with the new PATHs:

source ~/.zshrc

Then test:

which elixir
# => /usr/local/bin/elixir

elixir -v
# => Erlang/OTP 23 [erts-11.0.1] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [hipe]
# => Elixir 1.10.3 (compiled with Erlang/OTP 23)

Then get to work! :slight_smile:

asdf is awesome, I just think you might want to graduate to that after you’re more comfy with configuration, because it adds a layer of complexity.

If you get an error, type it into the search bar. Google, StackOverflow, etc. You’ll need them a lot. We all do.

Good luck.

1 Like

Well, one of the biggest problems with this approach is, that homebrew states to require macOS 10.13 minimum, while the OP said he uses 10.12.