'How to solve importmap bootstrap permission denied issue?

A light Ubuntu user here (WSL).

I issued the command in rails 7 (even as the root user) bin/importmap pin bootstrap and ./bin/importmap pin bootstrap but got a permission denied error -bash: bin/importmap: Permission denied.

Importmap is installed and present in .bin/importmap



Solution 1:[1]

Ran into the same issue on Mac OSX Catalina. The importmap file had exactly the same permissions as the other files in the bin directory (bundle, rake, etc.). All of them were set to rw-r--r--. What worked for me was adding executable rights for the owner (i.e. chmod 744 bin/importmap).

Not sure why the importmap file requires different permissions than the other files.

Solution 2:[2]

Added executable rights for the owner

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 ddb
Solution 2