installing compass on mac issue - ruby

I am installing compass on mac. when I run gem install compass command on terminal I got following output
I already have ruby ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin11.0] installed. I got this output after issuing ruby -v command on terminal.
How can fix above problems or how can I install compass successfully?

As far as I know you should be a root to install gems when using ruby from system.
It is a very good idea to run ruby with rvm or similar tools instead of running
system.

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

Can't find ruby or gem commands after doing ruby-install in Ubuntu

I have installed ruby 1.9.3 in my Ubuntu 12.04 machine following the instructions in https://github.com/postmodern/ruby-install and executing the following command:
sudo ruby-install ruby 1.9.3
I was assuming this would link from my /usr/bin or somewhere else visible from my path ruby or gem, but it doesn't. When I try for example: gem install bundler, I get:
sudo: gem: command not found
It also can't find ruby when I try ruby -v.
If I install with sudo apt-get install ruby1.9.3, I'm able to execute both ruby and gem:
$ ruby -v
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]
$ gem -v
1.8.11
I was expecting from ruby-install the same output I got from apt-get. Am I looking in the wrong place? How do I run ruby and gem after installing with ruby-install?
I know there are other installers for ruby like rvm and rbenv, but I'm following some installations instructions and they clearly instruct to use ruby-install.
Thanks in advance!
OK, found the answer.
After running
sudo ruby-install ruby 1.9.3
the last line from the log is:
>>> Successfully installed ruby 1.9.3-p547 into /opt/rubies/ruby-1.9.3-p547
Which I have no excuse for not paying attention to since it's in bold colourfull letters.
Erm, anyway, adding /opt/rubies/ruby-1.9.3-p547 to the PATH makes ruby and gem work.
export PATH=$PATH:/opt/rubies/ruby-1.9.3-p547/bin

ZSH cloudapp command not working

I've installed cloudapp_api multiple times with:
sudo gem install cloudapp_api
I just get this tho when running cloudapp wat.jpeg
"You need to install cloudapp_api: gem install cloudapp_api"
I really have no idea what to do.
Not sure if this helps, but i'm running ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]
You need to run gem install cloudapp_api

uninstall sass gem

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.

Upgraded to ruby 1.9.2 and getting Segmentation Fault errors in nokogiri

I decided to upgrade to 1.9.2 ruby yesterday and also installed rvm to do it. I ran a few recent files I had working previously on 1.8.7 but anything requiring nokogiri fails with the following errors.
/Users/myusername/.rvm/gems/ruby-1.9.2-p0/gems/nokogiri-1.4.3.1/lib/nokogiri/nokogiri.bundle: [BUG] Segmentation fault
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
I am running nokogiri 1.4.3.1, ruby 1.9.2 on OSX Snow Leopard 10.6.4
If you get a Segmentation fault error from nokogiri, e.g., when you open your rails console, and you are using RVM and your ruby version is 1.9.2 something (mine currently is 1.9.2p136) and you notice a reference to ruby 1.8.7 just after the nokogiri segmentation fault message, then perhaps the following may be of assistance...
ERROR
$ rails c
/Users/lex/.rvm/gems/ruby-1.9.2-p136#lmi/gems/nokogiri-1.4.4/lib/nokogiri/nokogiri.bundle: [BUG] Segmentation fault
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
Abort trap
SOLUTION
(1) make sure that ruby 1.8.7 is not a rvm ruby version:
- run rvm list
if it is, then remove it: ex: rvm uninstall ree-1.8.7-2010.02
(2) uninstall nokogiri and libxml2 related dependencies:
$ gem uninstall nokogiri
$ brew uninstall libxml2
(3) install libxml2 using homebrew
$ brew install libxml2
$ brew link libxml2
(4) install libxslt from source
$ wget ftp://xmlsoft.org/libxml2/libxslt-1.1.26.tar.gz
$ tar -zxvf libxslt-1.1.26.tar.gz
$ cd libxslt-1.1.26
$ ./configure --prefix=/usr/local/Cellar/libxslt/1.1.26 --with-libxml-prefix=/usr/local/Cellar/libxml2/2.7.7
$ make
$ sudo make install
(5) install nokogiri
gem install nokogiri
Alternative (ensure your paths are correct): gem install nokogiri -- --with-xml2-include=/usr/local/Cellar/libxml2/2.7.7/include --with-xml2-lib=/usr/local/Cellar/libxml2/2.7.7/lib --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.26
(6) test
$ rails c
Loading development environment (Rails 3.0.3)
>>
Getting and keeping your Ruby XML parsing libraries running properly can be an issue. Here are some alternatives: LibXML, Hpricot, REXML
I'm guessing you just need to tell rvm to use the correct ruby.
rvm 1.9.2
Otherwise why would your second line indicate 1.8.7?
You shouldn't expect native code compiled against one major version of ruby to link cleanly to another. There's no ABI contract, afaik.
https://rvm.io/rvm/basics/
https://rvm.io/rvm/cli/
Is it possible you originally built Nokogiri on Leopard then upgraded to Snow Leopard?
If so, do a gem uninstall nokogiri followed by gem install nokogiri. That will force it to recompile for your currently selected Ruby and OS.
I saw the similar problems when I upgraded from Leopard to Snow Leopard, and reinstalled my Ruby. The gems didn't get recompiled, so I had to force several of them to do so.
Try running rvm requirements in Terminal and see if there are any missing dependencies. (It shows in red in my OS X)
The returned notes helped me install missing dependencies with brew, with clearly stated steps.
all the suggestions here didn't work for me, but the abridged answer to this issue by mmrobins below:
rvm gemset empty
followed by a standard bundle install got everything working for me.

Resources