uninstall sass gem - sass

I just upgraded to OSX lion and my sass no longer works. I keep getting this error on the watch command
ents.rb:27: [BUG] Segmentation fault
ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0]
I read online that if you uninstall the sass gem and reinstall it it will fix the problem. I'm just not sure how to do that. Can anyone please help.

Open Terminal, and type:
sudo gem uninstall sass
Then type:
sudo gem install sass
Also if you install compass, it will install sass by default:
sudo gem install compass
To check which version you have installed, type sass -v
If this still doesn't solve your problem then you may want to re-install Ruby / Xcode.

Try this
to uninstall:
gem uninstall -Iax sass
& then to re-install use:
gem install sass --pre
or
gem install sass

The general problem is that every new version of the OSX ships with a new Mac Ruby compiler. The best way to avoid those kind kinds of problems is to use RVM (Ruby Version Manager) to manage your Ruby versions and avoid conflicts and missing gems (not really missing, just located in an older Ruby version).
RVM helps you keep all your gems organised and easy switching to different versions of Ruby.
For example, I use 1.9.2 version of Ruby using RVM, all my gems are located in my 1.9.2 Ruby folder. Easier to keep track, and easy to switch to newer versions of Ruby if needed.

Related

can't get sass command working on mac with 'brew install sass/sass/sass'

I installed Ruby many moons ago but never use it. Perhaps I inadvertently broke it as I seem to be having troubles with getting it working with the sass command.
After running the brew install sass/sass/sass I get the following error with sass command:
rbenv: sass: command not found
The `sass' command exists in these Ruby versions:
2.1.10
2.5.0
ruby -v yields:
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]
which I'm guessing is the stock version of Ruby on a mac.
The rbenv command prints out help so it looks like I have that installed. brew list shows I have the ruby package installed. I upgraded ruby with brew but that didn't help (it reported I upgraded from 2.6.1 to 2.6.2. I don't appear to have rvm installed.
If you're using RVM you shouldn't need to brew install anything, in fact you shouldn't.
See documentation here https://github.com/sass/ruby-sass which is deprecated and will refer you to use https://github.com/sass/sassc-ruby instead.
brew uninstall any ruby and ruby packages and just use rbenv to manage your ruby versions.
Once you set your ruby version with rbenv global 2.6.1 for example or whatever version you want, then just do
gem install sassc
Or in your Gemfile add
gem 'sassc`
and run
bundle install

How do I find which versions of ruby, gem and bundler are compatible?

I am using puppet to install ruby 1.9.3 as the system ruby on an Ubuntu Trusty Vagrant container. I also install Bundler. I am told that "gem" is installed as part of the installation of ruby.
How do I know which versions of gem go with this version of ruby?
How do I know which versions of bundler go with this version of ruby?
Here is a fragment of puppet code:
$other_reqs = [
...
'ruby1.9.3',
'ruby-bundler',
'rubygems-integration',
...
]
package{ $other_reqs: ensure => 'installed'} -> Package['percona-toolkit']
The package declaration will default to using apt-get to download packages. Clearly the line with 'ruby1.9.3' will get the 1.9.3 version of ruby. It also installed gem 1.8.23. Is this a compatible version of gem? How do I know?
The line with 'ruby-bundler' installed Bundler version 1.3.5. Is this a compatible version of Bundler? Or should I indicate a specific version in my requirements array? Where ought I look to find this information?
It might be helpful if you indicate the problem, or what you're trying to do. Nevertheless:
gem is a command that is built-in in ruby from 1.9+, so whatever comes installed with Ruby should be fine.
bunlder is a RubyGem, normally installed by doing gem install bundler. You can specify the version by doing gem install -v <version>. Either it gets installed correctly or you get an error. Can you install bundler doing that?
And lastly, unless you need it for a specific reason, 1.9 is very old :)

How do I run boxen in Mavericks with rbenv installed?

I recently upgraded to Mac OS 10.9 and now I get this message when I run boxen:
Bundler is not compatible with Ruby 2.0 or Rubygems 2.0. Please
upgrade to Bundler 1.3 or higher. Can't bootstrap, dependencies are
outdated
I imagined that I could just set boxen's .ruby-version file to something like 1.8.7, but based on the message above, it still seems to be using Ruby 2.0.
How can I run boxen in Mavericks?
I ran into the exact same issue. The answer is actually deceptively simple. Since Mavericks now includes Ruby 2.0.0p247 and Rubygems 2.0.3, and you apparently upgraded, your system ruby will not find your bundler or ansi gems. So what you need to do is install both with your system ruby, as root.
sudo /usr/bin/gem install bundler
sudo /usr/bin/gem install ansi
Then just restart or terminal. You can now run boxen as you would normally. Also, in order not to keep old files lying around, you may want to cleanup /Library/Ruby/Gems/1.8/ because it will include your old installation of both bundler and ansi on a ruby and gem installation you no longer have.
Seems the problem is with bundler. Just try to update it.
gem install bundler
system ruby (now 2.0) needed an updated version of bundler. Currently, only a pre-release version is compatible with Mac OS 10.9. If gem install bundler complains that you need a newer version of Bundler, as above, try gem install bundler --pre. Also, you may need elevated privileges to install gems for your system's ruby.
I am still confused about why Boxen wants to use system ruby's bundler gem when a different ruby installation is defined by Boxen's rbenv config, but the problem has a working solution now.

reinstall every gem for each ruby version?

I just installed Ruby 2.0.0 using rbenv and set it to the global ruby version for my system. Since 2.0 is compatible with 1.9.3, I tried to start up a Rails project with it, but got the following error. I did rbenv rehash after installing 2.0
The `rails' command exists in these Ruby versions:
1.9.3-p327
Does this mean that every gem I installed on my system with 1.9.3 has to be reinstalled if I wish to use it with 2.0?
As seen here:
You need to reinstall bundler for each version of Ruby you use. See Ruby versions where you have it installed:
rbenv whence bundle
See your current version:
rbenv version
Install bundler for that version, if missing:
gem install bundler
Yes. Rbenv (and RVM) have separate "gem home" directories for each installed version of Ruby. There may be ways to symlink certain directories to get them to share, but this will likely lead to problems, particularly with gems that include native C extensions, which may or may not compile and run cleanly in multiple versions.
If you have a Gemfile, easiest thing is to just bundle install again for Ruby 2.0, giving you duplicate copies of many gems and Ruby-2.0 compiled versions of any native gems.
Another solution to this is to copy (or reinstall) the gems from your previous version to the newly installed version. How to do that is answered in detail in this question, which has two scripts -- one to install from local cache, one to reinstall from the internet (mine).

How do I let bundle know I installed Ruby 1.9.2 on OS X Lion?

I installed Ruby 1.9.2 on OS X Lion using brew install ruby and updated gem to 1.8.11 using gem update --system.
However, on my Rails 3 project, bundle is still using the Ruby 1.8 path (/System/Library/Frameworks/Ruby.framework/Versions/1.8/Ruby) to install new gems and fails with packages that require Ruby 1.9 (linecache19 in my case).
How do I let bundle know that I installed 1.9.2?
(I tried using RVM to installed Ruby and failed for some reason. The installer simply hand. I think the network connection was too slow or something)
Did you set a default Ruby with RVM or create a .rvmrc in your Rails project? If not, do so and then install the Bundler gem for the correct Ruby version before doing a Bundle install.
Update: I kinda misread your question before. For your system you use Homebrew's Ruby, make sure /usr/local/bin comes in your PATH before /usr/bin (where the system Ruby lives).
I retried rvm and it now it works like a charm. Apparently, this is the way to go.

Resources