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

Ignoring clocale-0.0.4 error but everything works anyway #533

Open
1 of 4 tasks
helphop opened this issue Jun 6, 2022 · 8 comments
Open
1 of 4 tasks

Ignoring clocale-0.0.4 error but everything works anyway #533

helphop opened this issue Jun 6, 2022 · 8 comments

Comments

@helphop
Copy link

helphop commented Jun 6, 2022

I've read all of the comments and feed with regards to installing colorls on Mac M1 computers.

I'm using Homebrew and rbenv to manage my installations and ruby.

So far everything works as prescribed for colorls.

However, everytime I open my iTerm i get the following message:

Ignoring clocale-0.0.4 because its extensions are not built. Try: gem pristine clocale --version 0.0.4
Ignoring clocale-0.0.4 because its extensions are not built. Try: gem pristine clocale --version 0.0.4

I've attempted to follow the instructions:
gem pristine clocale --version 0.0.4

With the following result:

Restoring gems to pristine condition...
Building native extensions. This could take a while...
Restored clocale-0.0.4

However I still get the warning.

I've checked inside:

~/.rbenv/shims/

And I see the colorls gem installed but I don't see the clocale gem.

If I do:

which colorls

I get:

/Users/my_name/.rbenv/shims/colorls

However, if i do:

which clocale

I get:

clocale not found

Now If I look at the installed gems using gem list I can see that clocale is installed:

clocale (0.0.4)
colorls (1.4.6)

How can I fix the warning message:
Ignoring clocale-0.0.4 because its extensions are not built. Try: gem pristine clocale --version 0.0.4

  • Relevant Issues : (none)
  • Relevant PRs : (none)
  • Type of issue :
    • Installation
    • Font-related
    • Feature request
    • [x ] Bug in existing feature
    • Developer mode : Code quality / Tests / Documentation
@helphop
Copy link
Author

helphop commented Jun 7, 2022

I managed to figure out the problem.

  1. I had an old copy of colorls and clocale under my /Library/ruby/gems folder
  2. I had to switch the order of the following in my .zshrc file:
# Load rbenv automatically by appending
# the following to ~/.zshrc:
export PATH="$HOME/.rbenv/bin:$PATH"  <- must come before the code below
eval "$(rbenv init - zsh)" <- must come before the code below

eval "$(starship init zsh)"
source $(dirname $(gem which colorls))/tab_complete.sh

alias la='colorls -h --group-directories-first -1'
alias ld='colorls -d'
alias lf='colorls -f'

alias l='colorls --group-directories-first --almost-all'

alias ll='colorls --group-directories-first --almost-all --long'

@bobopon
Copy link

bobopon commented Nov 19, 2022

你好,我遇到了跟你一样的问题。

该问题是由于ruby环境错乱导致的。
我通过以下步骤得以解决该问题:
1、通过homebrew卸载ruby和brew-gem
2、通过homebrew安装rbenv和ruby-build
3、通过rbenv创建新ruby环境,“rbenv install 3.1.2”、“rbenv global 3.1.2”
4、通过“which ruby”查询刚刚创建的ruby环境的地址(例如我的地址是:/Users/bb/.rbenv/versions/3.1.2/bin/ruby)
5、在zsh文件中添加环境变量,“nano ~/.zshrc”,在最底下添加“export PATH="/Users/bb/.rbenv/versions/3.1.2/bin:$PATH””,“source ~/.zshrc”,“rbenv rehash”
6、你的ruby环境已经配置完毕。接下来,重新安装colorls即可。“gem install colorls”,“source $(dirname $(gem which colorls))/tab_complete.sh”

希望来了个够帮助到你~

Hello, I have encountered the same problem as you.

This problem is caused by the confusion of the ruby ​​environment.
I was able to resolve the issue by following steps:

  1. Uninstall ruby ​​and brew-gem through homebrew
  2. Install rbenv and ruby-build via homebrew
  3. Create a new ruby ​​environment through rbenv, "rbenv install 3.1.2", "rbenv global 3.1.2"
  4. Use "which ruby" to query the address of the ruby ​​environment just created (for example, my address is: /Users/bb/.rbenv/versions/3.1.2/bin/ruby)
  5. Add environment variables in the zsh file, "nano ~/.zshrc", add "export PATH="/Users/bb/.rbenv/versions/3.1.2/bin:$PATH"" at the bottom, "source ~/.zshrc", "rbenv rehash"
  6. Your ruby ​​environment has been configured. Next, reinstall colorls. "gem install colorls", "source $(dirname $(gem which colorls))/tab_complete.sh"

I hope this is enough to help you~

@mgd722
Copy link

mgd722 commented Mar 20, 2023

I started getting this after upgrading to macOS Ventura.

I don't do any ruby dev so I can't say if this was the right thing to do or not, but my one line fix was sudo gem install colorls using the system default ruby install.

EDIT: just upgraded to macOS Sonoma and had to do the same thing again. Seemed to work.

@jerinthomas1404
Copy link

@mgd722 It worked 😄 . @helphop I couldn't find any copy of colorls on my machine.

@JonasASchmidt
Copy link

I have the same problem and cannot solve it until today.
Bildschirmfoto 2023-11-07 um 15 43 27

@avdv
Copy link
Collaborator

avdv commented Nov 7, 2023

Try to debug your init script and figure out at which point the message is generated.

In general, you should be able to use a Ruby version manager, but instead of trying to configure your PATH to include the version, my suggestion would be to define an alias for colorls to actually call your Ruby version manager with a specific environment, something along the lines of alias colorls='rbenv --env ruby-3.2.1 exec colorls. Otherwise you will probably run into problems when the version manager switches environments.

@mascanho
Copy link

Had the same issues, update apple's dev tools (Xcode) then made sure to accept the agreement with xcode build -license. After that installed colorls with gem without issues. All working now.

@kcalmond
Copy link

@bobopon 's response above fixed this problem for me. I'm running ohmyzsh setup on macos sonoma/ARM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants