Giter Site home page Giter Site logo

Comments (7)

matiasict avatar matiasict commented on September 26, 2024 6

I have the same problem. You can fix it like this:

cd /usr/local/
sudo mkdir bin
sudo chmod 777 bin

from terraform-switcher.

skyzyx avatar skyzyx commented on September 26, 2024 6

I have the same problem. You can fix it like this:

cd /usr/local/
sudo mkdir bin
sudo chmod 777 bin

Nothing personal, but this is bad advice from a security angle.

If you find yourself setting directories to 0777, then something is wrong. Check user and group associations before setting things (especially entire directories) to 0777. Do you simply need to add your user to a particular group? On macOS, do you just need to add yourself to the wheel or admin group?

from terraform-switcher.

davehowell avatar davehowell commented on September 26, 2024 4

Looks like there are now M1 (arm) releases since 1.0.2 https://releases.hashicorp.com/terraform/1.0.2/terraform_1.0.2_darwin_arm64.zip

I've previously added ~/bin to my PATH so I don't have any issue with this, as per #151

I tried running tfswitch in another repo, which installed 1.0.4. When I run terraform -v I can see it has installed the amd64 binary, not the arm64. It doesn't matter; that amd64 (x86_64) binary works just fine, but perhaps some point in the future it should pick the correct build for this architecture.

from terraform-switcher.

blugri avatar blugri commented on September 26, 2024 1

@skyzyx Are you on the M1 chipset? I have the problem on M1.

from terraform-switcher.

skyzyx avatar skyzyx commented on September 26, 2024

I'm on Big Sur, and I don't have this issue.

from terraform-switcher.

skyzyx avatar skyzyx commented on September 26, 2024

Ah. I'm on x86. I think the M1 is context I didn't see in the original post.

Terraform doesn't have official releases for M1 yet. That's probably the problem.

from terraform-switcher.

pckilgore avatar pckilgore commented on September 26, 2024

Seems to be a permissions issue (which idk why that would be different between Big Sur arches), easy workaround seems to be to give tfswitch a user-owned directory (I add ~/bin as top item in PATH in my profile):

(✓) 19:06:30 [~/code/pckilgore/learn-terraform-circleci::master]
$ tfswitch
Reading required version from terraform file
Reading required version from constraint: > 1.0.0
Matched version: 1.0.1
2021/06/28 19:06:45
		Unable to create new symlink.
		Maybe symlink already exist. Try removing existing symlink manually.
		Try running "unlink /usr/local/bin/terraform" to remove existing symlink.
		If error persist, you may not have the permission to create a symlink at/usr/local/bin/terraform.
		Error: symlink /Users/patrick/.terraform.versions/terraform_1.0.1 /usr/local/bin/terraform: permission denied


(✖ - 1) 19:06:45 [~/code/pckilgore/xxx::master]
$ tfswitch -b ~/bin/terraform
Reading required version from terraform file
Reading required version from constraint: > 1.0.0
Matched version: 1.0.1
Switched terraform to version "1.0.1"

(✓) 19:06:53 [~/code/pckilgore/xxx::master]
$ which terraform
/Users/patrick/bin/terraform

(✓) 19:07:00 [~/code/pckilgore/xxx::master]
$ terraform -v
Terraform v1.0.1
on darwin_amd64
+ provider registry.terraform.io/hashicorp/aws v3.44.0
+ provider registry.terraform.io/hashicorp/local v2.1.0
+ provider registry.terraform.io/hashicorp/random v3.1.0
+ provider registry.terraform.io/hashicorp/template v2.2.0

Happy to help debug some more if you have ideas but the workaround is pretty easy.

from terraform-switcher.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.