Can't access Sass version or help from Terminal - dart

I've installed Sass with Brew, but when I try:
sass --version or sass --help
I get this error:
Usage: /usr/local/Cellar/dart/2.4.1/libexec/bin/dart2aot [options] <dart-source-file> <dart-aot-file>
Dart AOT (ahead-of-time) compile Dart source code into native machine code.

There was a bug in the Homebrew package of Sass:
https://github.com/sass/homebrew-sass/issues/19
It's now corrected with the pull request:
https://github.com/sass/homebrew-sass/pull/20
Reinstall completely Sass with
brew reinstall sass/sass/sass

Related

Rails Error Can't Find freedesktop.org.xml

I've had some issues starting a new RAILS project, where I'm getting an error that there is a missing file /usr/local/share/mime/packages/freedesktop.org.xml. There was a connection with the mimemagic dependencies, and I found this issue on GitHub about the mimemagic version and licensing - https://github.com/rails/rails/issues/41750
Wondering if anybody else ran into the issue, and could explain what is going on.
I'm using rbenv with ruby version: 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin19], and rails 6.1.3
Here is the error message in the command line:
Installing railties 6.1.3
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /Users/nico/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/mimemagic-0.3.7/ext/mimemagic
/Users/nico/.rbenv/versions/3.0.0/bin/ruby -I/Users/nico/.rbenv/versions/3.0.0/lib/ruby/3.0.0 -rrubygems
/Users/nico/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rake-13.0.3/exe/rake
RUBYARCHDIR\=/Users/nico/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/extensions/x86_64-darwin-19/3.0.0/mimemagic-0.3.7
RUBYLIBDIR\=/Users/nico/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/extensions/x86_64-darwin-19/3.0.0/mimemagic-0.3.7
rake aborted!
Could not find MIME type database in the following locations: ["/usr/local/share/mime/packages/freedesktop.org.xml",
"/opt/homebrew/share/mime/packages/freedesktop.org.xml", "/usr/share/mime/packages/freedesktop.org.xml"]
Ensure you have either installed the shared-mime-types package for your distribution, or
obtain a version of freedesktop.org.xml and set FREEDESKTOP_MIME_TYPES_PATH to the location of that file.
Tasks: TOP => default
(See full trace by running task with --trace)
rake failed, exit code 1
Thanks,
Nico
Found some links to shared-mime-info on the GitHub link I posted, and I solved the issue by running the command below and starting a new project:
brew install shared-mime-info
If you are on ubuntu OS you can run below command
sudo apt-get install shared-mime-info
If migrating data from an Intel Mac (or an M1 Mac running Rosetta 2) to an M1, note that mimemagic will cache the old directory, so in addition to brew install shared-mime-info, you'll want to run:
gem uninstall mimemagic
gem install mimemagic

Gemset error when updating to Ruby 2.4.2

I'm updating from Ruby 2.0 to 2.4.2 using RVM, and receive the following error messages during an install using $ rvm install ruby-2.4.2:
Making gemset ruby-2.4.2 pristine - please wait
'command gem pristine --extensions bigdecimal --version 1.3.0 gem-wrappers --version 1.3.2 io-console --version 0.4.6 json --version 2.0.4 openssl --version 2.0.5 psych --version 2.2.2' failed, you need to fix this gems manually.
Error running '__rvm_with ruby-2.4.2 gemset_pristine',
please read /Users/myname/.rvm/log/1507820191_ruby-2.4.2/gemset.pristine-ruby-2.4.2.log
Making gemset ruby-2.4.2#global pristine - please wait
'command gem pristine --extensions bigdecimal --version 1.3.0 io-console --version 0.4.6 json --version 2.0.4 openssl --version 2.0.5 psych --version 2.2.2' failed, you need to fix this gems manually.
Error running '__rvm_with ruby-2.4.2#global gemset_pristine',
please read /Users/myname/.rvm/log/1507820191_ruby-2.4.2/gemset.pristine-ruby-2.4.2#global.log
I'm… not quite sure what this means, or what I should do next. Any thoughts? I'm running macOS 10.12.6.
[Edit]: Here's a copy of the error log.
According to the RVM docs, you don't use ruby- in the command.
It should be:
$ rvm install 2.4.2
I'm not sure if that matters or not though.
Have you tried upgrading RVM and Homebrew?
[Edit] Based on this info from the log file:
bigdecimal-1.3.0 +gemset_pristine:20> gem pristine --extensions bigdecimal --version 1.3.0
ERROR: Loading command: pristine (LoadError)
cannot load such file -- zlib
ERROR: While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass
+gemset_pristine:21> _failed+=( 'bigdecimal --version 1.3.0' )
Looks like a zlib problem. Try installing (or re-installing) Command Line Tools.
$ xcode-select --install
There is a very similar issue on github https://github.com/rvm/rvm/issues/4090
It was solved by running $ brew doctor
Just came up against this after needing to use SASS after a while. During which time I had upgraded to El Capitan. So Ruby was 'Old'.
You could probably cut a lot of my steps out by running the following (with a little prior knowledge of the latest Ruby Version).
xcode-select --install
brew install zlib
rvm reinstall ruby-<latest_version> --with-zlib-dir=/usr/local/Cellar/zlib/<latest_version>
This was how I had to go about it. I didn't need to uninstall in the end but I took a lot of wrong turns.
Initially I had to run this line to get xcode up to date:
xcode-select --install
Then install zlib
brew install zlib
Take a note of the directory zlib is installed in
/usr/local/Cellar/zlib/1.2.11
Next update rvm
\curl -sSL https://get.rvm.io | bash -s stable --ruby
Following these steps got me to the point where I was running the latest version of ruby 2.4.1. But zlib wasn't linked to ruby.
So the final step was to run a reinstall
rvm reinstall ruby-2.4.1 --with-zlib-dir=/usr/local/Cellar/zlib/1.2.11
Found a fix as referenced in this RVM GitHub issue that involves installing zlib using brew and then re-installing ruby while pointing to that zlib directory.
As someone in that thread pointed out, this shouldn't be necessary. Still not sure why the problem arose.
Steps
$ brew install zlib
$ rvm remove 2.4.2
$ rvm install 2.4.2 —-with-zlib-dir=/usr/local/Cellar/zlib/1.2.11

Bower install downgrades my package

Every time I install a new bower package on my Ember CLI pack, I got
Missing bower packages:
Package: ember
* Specified: 1.11.0
* Installed: 1.10.0
then I run bower install ember#1.11.0.
Unable to find a suitable version for ember, please choose one:
1) ember#1.10.0 which resolved to 1.10.0 and is required by test-addon
2) ember#>= 1.8.1 < 2.0.0 which resolved to 1.11.0 and is required by ember-data#1.0.0-beta.16
3) ember#> 1.5.0-beta.3 which resolved to 1.11.0 and is required by ember-resolver#0.1.15
4) ember#>=1.4 <2 which resolved to 1.11.0 and is required by ember-cli-shims#0.0.3
5) ember#1.11.0 which resolved to 1.11.0Prefix the choice with ! to persist it to bower.json
I choose 5 (Why this hassle if I explicit added the desired version), then it works again.
But next time if I install a new bower package, I have to do it again.
node 0.12.1
bower 1.3.12
emvber cli 0.2.2
You may use -F flag to force to use latest version:
bower install -F
(see docs)
In this case bower didn't asking anything about versions.

ffi fails to build via bundler on MacOS 10.8.5

PROBLEM:
bundler fails to build ffi and so my rails apps are broken in my development environment.
None of the posts that I've read have solutions that work for me. I get the same error in a number of rails apps.
What other troubleshooting steps can I take?
How do I fix this issue?
BACKGROUND:
After an upgrade to Mountain Lion from Snow Leopard, Xcode upgrade, Clean Homebrew install, I did a clean install of rvm. Now I am trying to recreate the gemsets used by my rails apps. I did:
gem install rails -v3.2.16 (to get the base rails gems installed)
rvm gemset import ruby-1.9.3-p545#CLIENTNAME.gems (to import gems)
bundle install (to install dependencies and resync gemfile.lock)
ISSUE:
bundle install fails with this error message:
An error occurred while installing ffi (1.9.3), and Bundler cannot continue.
Make sure that gem install ffi -v '1.9.3' succeeds before bundling.
The complete gem_make.out is here: https://gist.github.com/mattmartini/b2f8ad3b4e6c57325d38
The mkmf.log is here: https://gist.github.com/mattmartini/d3256cb52e5eafb2346b
The config.log is here: https://gist.github.com/mattmartini/69407e118e92cadda2b0
I would like to stay on ruby 1.9.3 as the Production servers are using this.
OBSERVATIONS:
One of the errors thrown is that 'C compiler cannot create executables' - this is not true. I can compile C programs and bundler built nokogiri without a problem.
I did just notice that libffi, which was installed (along with gcc46) by rvm, is keg only. Would bundler be able to use the lib in creating the gem?
ENVIRONMENT:
Mac OS X 10.8.5 (Mountain Lion)
Xcode 5.0.2 (command line tools installed)
Homebrew 0.9.5 (recent fresh install)
rvm 1.25.25 (stable)
ruby 1.9.3-p545
libffi 3.0.13 (brew via rvm)
gcc46 (brew via rvm)
REVIEWED:
I reviewed a number of posts of similar issues, but none had a solution that worked for me, including:
https://github.com/ffi/ffi/issues/286
Note I had a bunch of stack overflow links here but I couldn't submit this question with them.
My hunch about libffi being keg only was correct. After linking libffi, bundle used this lib instead of trying to compile it. This resolves the issue of getting the gem installed, but doesn't resolve why it fails to compile.
Since the lib is keg only you have to force it to link:
brew link libffi --force

Issue installing capybara-webkit gem, recursive error?

Installing capybara-webkit (0.11.0) with native extensions Unfortunately, a fatal error has occurred. Please report this error to the Bundler issue tracker at https://github.com/carlhuda/bundler/issues so that we can fix it. Please include the full output of the command, your Gemfile and Gemfile.lock. Thanks!
/Users/me/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:551:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
/Users/me/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb
/Users/me/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.15/lib/bundler/spec_set.rb:87:in `block in materialize': Could not find capybara-webkit-0.11.0 in any of the sources (Bundler::GemNotFound)
When I try to install the capybara-webkit gem, it says it cannot find the capybara-webkit gem. I already have qt4 installed:
$ sudo port list installed | grep qt4
qt4-mac #4.7.4 aqua/qt4-mac
Any idea what the issue could be?
I'd try installing qt using brew rather than port.
I have capybara-webkit installed on my mac right now (version 0.11.0 just as you were attempting to install) and it installed and works great.
However, I don't have port on my machine. I use brew to install most everything now.
So
brew install qt
could make a difference.
Here's a link to an installation script used by the team at Thoughtbot (the people who built and support capybara-webkit) -- you can see that it installs qt using brew as well:
https://github.com/thoughtbot/laptop/blob/master/mac
echo "Installing QT, used by Capybara Webkit for headless Javascript integration testing ..."
brew install qt
I'm quite late on this one, but I've had a similar problem and figured out the problem was I had Macports and Homebrew installed.
So I uninstalled Macports:
sudo port -fp uninstall installed
Updated my Homebrew:
brew update (that took a while)
And then installed QT with only brew installed asking to build from source:
brew install qt --build-from-source (that took like 25 minutes to finish)
If you try qmake -v now, you'll probably get an error saying qmake is not in /opt/local/bin. This is because Homebrew installed QT in /usr/local/bin, and you have to add it to your PATH with the next command:
export PATH="/usr/local/bin:$PATH"
In the end it took me like 3 hours to find the solution, but it worked like a charm.
I hope this helps other people having the same issue.

Resources