Unable to use Sass on macOS Catalina - ruby

Since upgrading to Catalina I'm not being able to use Ruby Sass. I tried installing Node Sass but I keep getting this message:
dyld: Library not loaded: /Users/luiscarlospandocarrera/.rvm/rubies/ruby-2.5.0/lib/libruby.2.5.dylib
Referenced from: /Users/luiscarlospando/.rvm/rubies/ruby-2.5.0/bin/ruby
I tried uninstalling Ruby Sass, reinstalling it and I just keep getting this message.
What would I need to do?
Thanks in advance!

This looks like a Ruby problem, so maybe reinstall Ruby, or possibly bump to a newer version to see if that side-steps the issue. 2.7.0 is out and worth a shot. From time to time an OS upgrade will pull a library your locally built Ruby depends on, so you need to rebuild Ruby to link to the new, updated libraries.

Ruby SASS is EOL (26 March 2019) - https://sass-lang.com/ruby-sass and you should try to find other ways to "compile" your SASS files.
I uses sassc with PHPStorm as a runner for the themes that uses SASS.
Easiest way to install is by using homebrew:
brew install sassc
You should also consider using https://github.com/sass/dart-sass

I managed to solve this problem by installing the latest version of Ruby as suggested by tadman by using Ruby Version Manager (rvm).
To do it I did the following steps:
Installed the latest version of rvm:
curl -L https://get.rvm.io | bash -s stable and then I had to restart the terminal.
Installed the latest version of Ruby:
rvm install ruby-2.7.0
I did set v2.7.0 as the version of Ruby I wanted to use:
rvm --default use ruby-2.7.0
I hope this helps!

Related

RVM, where is Ruby 3.0.0?

I want to download the latest Ruby release(version 3.0.0), using RVM but I am faced with the following error when running rvm install 3.0.0:
Unknown ruby interpreter version (do not know how to handle): 3.0.0
I have also tried 3 & 3.0, but gives the same error.
According to this page, it should be available through RVM. I'm already using RVM to manage my ruby versions, so I don't want to use rbenv ... nor do I want to install from source.
How can I get Ruby version 3.0.0 installed using RVM?
If you have not updated rvm do that first RVM Upgrading
rvm get stable
# or
rvm get master # for even newer versions not in stable 3.0.0 in this case
To see all available rubies run
rvm list remote all
# or
rvm list known # as pointed out in the comments
you should see ruby-3.0.0 in the list of available rubies
Then run
rvm install ruby-3.0.0
In many parts of the world, the current time is holiday time. RVM is maintained by unpaid volunteers in their spare time, who might choose to spend time with their families.
Therefore, it might take a while for a new release of RVM to come out.
Also, there are a couple of bugs related to YARV 3.0.0 not working on the RVM bug tracker, obviously those will need to be fixed before a new release of RVM that supports YARV 3.0.0 can be released.
According to the RVM offline installation docs, the required extension to install any Ruby version is .tar.bz2.
Taking a look at the Ruby's 3 FTP folder, the .tar.bz2 is available only for the preview1 release. Neither the rc1 nor the official has that extension available yet.
I think we gotta wait for some maintainer to update the FTP folder with that extension.
First you need to upgrade the RVM. Then try to install the needed version again ->
rvm get master && rvm install 3.0.0
You can just rename the .tar.gz file to be a .tar.bz2 and everything will work. Here's the steps:
As stated in previous answers, update rvm to the latest stable version with:
rvm get stable
Download the release 3.0.0 gz file from: https://cache.ruby-lang.org/pub/ruby/3.0/ruby-3.0.0.tar.gz
Move the downloaded file into your .rvm/archives folder and rename it to a .bz2 in the process:
mv ~/Downloads/ruby-3.0.0.tar.gz ~/.rvm/archives/ruby-3.0.0.tar.bz2
Make sure you've got at least gcc v8 installed, or newer. This is required due to the multi-threaded concurrency features of Ruby 3. I used gcc-10, which on my Mac I had installed with Homebrew. If you do use a newer version of gcc then you'll need to set the CC environment variable:
export CC=gcc-10
With everything now in place, install as usual, which will automatically find the appropriate .bz2 file in your archives folder:
rvm install ruby-3.0.0

Trouble running RubyGems on Redhat 5.5

Am trying to install Ruby and RubyGems on a RedHat 5.5 machine. I'd got them by running the following two commands:
sudo yum install ruby
sudo yum install rubygems
Got both installed. However when i try to run gem, i got the following error:
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
require': undefined methodend_with?' for "no such file to load --
Win32API":String (NoMethodError)
from /usr/lib/ruby/site_ruby/1.8/rubygems/config_file.rb:55
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in
gem_original_require'
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:inrequire'
from /usr/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:8
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in
gem_original_require'
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:inrequire'
from /usr/bin/gem:9
Doesn't matter what kind of command i run, it throws that. (I tried gem -v, gem update)
The version of Ruby seems to be 1.8 but i have problem determining the RubyGems version. I'd vi into rubygems.rb and at the top it stats the version as 1.5.
Try to fix by running the downgrade command as proposed here, but it throws the same error as well.
Any help on fixing this issue? Just want to get this running so that i can run a RoR apps..
RedHat 5 ships with Ruby 1.8.5 and an equally old rubygems. Both, the rubygems and the ruby version is WAY too old to be supported by anything outside the base packages of the OS anymore. Even in the OS packages, they probably won't change anything on their own due to the age of their whole system.
If you really want/have to use Ruby on Red Hat 5, you probably need to get another source for it that the RPMs provided by the OS, e.g. rbenv / ruby-build or ruby-install or even rvm. You should use a newer Ruby version, i.e. a 2.1 or 2.2 version. All Ruby versions < 2.0 are unsupported by the language developers by now.
Alternatively, you should try to use a newer version of RedHat, i.e. RedHat 7 which doesn't need to support to 8 year old software...
Suspicious here is that yum installed ruby 1.8 which is pretty outdated version, it seems you have two versions of ruby on your system now and gem tries to use the old one.
Check the version of the package installed recently and try to force rubygems to use the new version(by removing the old ruby or linking to the path returned by which ruby)

Why can I not install ruby 1.9.3-p488 via homebrew?

I already have ruby version 2.0 but for a project, I need version 1.9.3-p448. When I try to run the ruby build I get the following:
ruby-build: definition not found: 1.9.3-p448
You can list all available versions with `rbenv install --list'.
If the version you're looking for is not present, first try upgrading
ruby-build. If it's still missing, open a request on the ruby-build
issue tracker: https://github.com/sstephenson/ruby-build/issues
The highest 1.9.3 version that comes up when i run rbenv install --list is 1.9.3-p429 and I can't figure out how to do a manual install. All of the documentation I have read only has instructions from the start but nowhere addresses this issue.
I had a similar problem and I uninstalled ruby build then reinstalled it and it worked. Hope that works!
You need to upgrade rbenv. 1.9.3-p448 is available in the current version.

Can't install Ruby 2.0.0 using RVM

I'm trying to install Ruby version 2.0.0 using RVM. I'm trying to use the Rails installer (railsinstaller.org).
I have downloaded the package and ran the installer and I have also restarted all terminal windows.
Here is the issue I am encountering:
my terminal http://img822.imageshack.us/img822/9704/stacks.png
As you can see, it says that RVM installed Ruby version 2.0.0. When I try to tell RVM to use this version it says that it is not installed.
Looks like it may have been fixed. Try rvm get head and then try again: https://github.com/wayneeseguin/rvm/issues/1832

How to update Ruby to 1.9.x on Mac?

I have created a new user account on my mac and I am trying to update to the current version of ruby on it (1.9.2) from the snow leopard default of 1.8.7. Can somebody point me to tutorial or explain the best method to update Ruby on my mac from 1.8 to 1.9.2? Thanks
As The Tin Man suggests (above) RVM (Ruby Version Manager) is the Standard for upgrading your Ruby installation on OSX: https://rvm.io
To get started, open a Terminal Window and issue the following command:
\curl -L https://get.rvm.io | bash -s stable --ruby
( you will need to trust the RVM Dev Team that the command is not malicious - if you're a paranoid penguin like me, you can always go read the source: https://github.com/wayneeseguin/rvm ) When it's complete you need to restart the terminal to get the rvm command working.
rvm list known
( shows you the latest available versions of Ruby )
rvm install ruby-2.3.1
For a specific version, followed by
rvm use ruby-2.3.1
or if you just want the latest (current) version:
rvm install current && rvm use current
( installs the current stable release - at time of writing ruby-2.3.1 - please update this wiki when new versions released )
Note on Compiling Ruby: In my case I also had to install Homebrew Link to get the gems I needed (RSpec) which in turn forces you to install Xcode (if you haven't already) https://itunes.apple.com/us/app/xcode/id497799835 AND/OR install the GCC package from: https://github.com/kennethreitz/osx-gcc-installer to avoid errors running "make".
Edit: As of Mavericks you can choose to install only the Xcode command line tools instead of the whole Xcode package, which comes with gcc and lots of other things you might need for building packages. It can be installed by running xcode-select --install and following the on-screen prompt.
Examples: https://rvm.io/workflow/examples/
Screencast: http://screencasts.org/episodes/how-to-use-rvm
Note on erros: if you get the error "RVM is not a function" while trying this command,
visit: How do I change my Ruby version using RVM? for the solution.
I'll make a strong suggestion for rvm.
It's a great way to manage multiple Rubies and gems sets without colliding with the system version.
I'll add that now (4/2/2013), I use rbenv a lot, because my needs are simple. RVM is great, but it's got a lot of capability I never need, so I have it on some machines and rbenv on my desktop and laptop. It's worth checking out both and seeing which works best for your needs.
With brew this is a one-liner:
(assuming that you have tapped homebrew/versions, which can be done by running brew tap homebrew/versions)
brew install ruby193
Worked out of the box for me on OS X 10.8.4. Or if you want 2.0, you just brew install ruby
More generally, brew search ruby shows you the different repos available, and if you want to get really specific you can use brew versions ruby and checkout a specific version instead.
I know it's an older post, but i wanna add some extra informations about that.
Firstly, i think that rvm does great BUT it wasn't updating ruby from my system (MAC OS Yosemite).
What rvmwas doing : installing to another location and setting up the path there to my environment variable ... And i was kinda bored, because i had two ruby now on my system.
So to fix that, i uninstalled the rvm, then used the Homebrew package manager available here and installed ruby throw terminal command by doing brew install ruby.
And then, everything was working perfectly !
The ruby from my system was updated !
Hope it will help for the next adventurers !
I'll disagree with The Tin Man here. I regard rbenv as preferable to RVM. rbenv doesn't interfere drastically with your shell the way RVM does, and it lets you add separate Ruby installations in ordinary folders that you can examine directly. It allows you to compile Ruby yourself. Good outline of the differences here: https://github.com/sstephenson/rbenv/wiki/Why-rbenv%3F
I provide instructions for compiling Ruby 1.9 for rbenv here. Further, more detailed information here. I have used this technique with easy success on Snow Leopard, Lion, and Mountain Lion.
Dan Benjamin's Hivelogic article Installing Ruby, RubyGems, and Rails on Snow Leopard is the recommended place to go although the article is for 1.8, so here's a Ruby 1.9-specific install on Snow Leopard. Watch out for the 64-bit thing... either go all 64-bit 'fat' (as is - for example - Apache on OS X, which can cause problems with 32-bit libraries) or check any gems you're likely to use to make sure they're okay for 64-bit.
This command actually works
\curl -L https://get.rvm.io | bash -s stable --ruby
As previously mentioned, the bundler version may be too high for your version of rails.
I ran into the same problem using Rails 3.0.1 which requires Bundler v1.0.0 - v1.0.22
Check your bundler version using: gem list bundler
If your bundler version is not within the appropriate range, I found this solution to work: rvm #global do gem uninstall bundler
Note: rvm is required for this solution... another case for why you should be using rvm in the first place.
There are several other version managers to consider, see for a few examples and one that's not listed there that I'll be giving a try soon is ch-ruby. I tried rbenv but had too many problems with it. RVM is my mainstay, though it sometimes has the odd problem (hence my wish to try ch-ruby when I get a chance). I wouldn't touch the system Ruby, as other things may rely on it.
I should add I've also compiled my own Ruby several times, and using the Hivelogic article (as Dave Everitt has suggested) is a good idea if you take that route.

Resources