Getting this error when installing Cocoapods [duplicate] - ruby

This question already has answers here:
Cocoapods installation error in terminal
(3 answers)
Closed 6 years ago.
I am having an issue trying cocoapods.
Last login: Sat Mar 26 20:17:39 on console
Brians-MacBook-Air:~ katypatterson$ sudo gem install cocoapods
Password:
ERROR: Error installing cocoapods:
activesupport requires Ruby version >= 2.2.2.
Brians-MacBook-Air:~ katypatterson$
Do I have install Ruby version 2.2.2 ?

First you need install active script :
sudo gem install activesupport -v 4.2.6
sudo gem install -n /usr/local/bin cocoapods

installing ruby
in terminal write the commands below:
rm -rf ~/.rvm
curl -L https://get.rvm.io | bash -s stable

Related

Updated to High Sierra and having trouble running compass

I updated to High Sierra earlier this week and am having trouble running compass. When trying to run compass watch it gives me this error:
compass watch
-bash: /usr/local/bin/compass: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby: bad interpreter: No such file or directory
Tried to update ruby and failed. I have version 2.3. I don't have version 2.0 thats its looking for. so tried to change the path, failed again.
Also tried to update/reinstall compass.
I get an error saying I don't have permission to make changes.
I had the same problem. Solved it by running:
$ sudo gem uninstall compass
$ gem update --system
$ sudo gem install compass
Hope it works for you!
UPDATE:
From ewartx: https://github.com/Compass/compass/issues/2129
\curl -sSL https://get.rvm.io | bash -s stable
rvm install 2.0.0
gem install compass
If you don't want to revert, this worked for me (slightly modified from an answer here https://github.com/oklai/koala/issues/679)
Open Terminal
Install Homebrew: ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Do not close Terminal, open Mac Appstore and check Update, install all XCode Command Line Tools updates OR in my case, XCode Command Line Tools started install automaticly throught Terminal right after step
2.
Back to Terminal
Install Ruby: brew install rbenv ruby-build
At this point, install Compass (instead of SASS in original answer)
Install Compass gem: sudo gem install -n /usr/local/bin compass
I just ran into this as well. The solution was to make sure that the xCode command line tools were installed.
Run the following to install the needed development files.
xcode-select --install
Per #Adi's solution run this to uninstall compass and reinstall it.
sudo gem uninstall compass
gem update --system
sudo gem install compass
After that is complete you should be able to use compass and can re-run your command.

Error for macos sierra install cocoapods

When i install mac os sierra, trying install cocoapods, but appear error:
ERROR: While executing gem ... (Gem::Exception)
Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources
but i already installed openssl and ruby,i really don't know is why,does anyone know?
Install Cocoapods by below 3 commands
sudo gem update --system -n/usr/local/bin
sudo gem install -n /usr/local/bin cocoapods
pod setup

Compass doesn't work after update to OS X El Capitan (10.11) [duplicate]

This question already has answers here:
Can't install gems on OS X "El Capitan"
(15 answers)
Closed 7 years ago.
After installing OS X El Capitan (10.11) my ruby compass is no longer working. After trying to install compass I recieve error message like this:
$ sudo gem install compass
ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted - /usr/bin/compass
How this can be fixed?
I had the same problem after upgrading to OS X El Capitan (10.11), but while trying to sudo gem install sass. The poster's solution of putting the path in the install command worked for me, and installing compass also installs sass, so: sudo gem install -n /usr/local/bin compass did the trick. Thanks Leo!
The fix I found was simply to put the PATH in the install command for any ruby gem package:
$ sudo gem install -n /usr/local/bin GEM_PACKAGE_NAME
So with compass it worked for me as:
$ sudo gem install -n /usr/local/bin compass
Good Luck!

Error Installing Jekyll on Mac OS Mavericks (10.9.2)

Trying to install stable version of Jekyll on OSX Mavericks. I have Xcode and the command line tools installed, yet I get this error:
sudo gem install jekyll
Password:
Building native extensions. This could take a while...
ERROR: Error installing jekyll:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling porter.c
porter.c:359:27: warning: '&&' within '||' [-Wlogical-op-parentheses]
if (a > 1 || a == 1 && !cvc(z, z->k - 1)) z->k--;
~~ ~~~~~~~^~~~~~~~~~~~~~~~~~~~
porter.c:359:27: note: place parentheses around the '&&' expression to silence this warning
if (a > 1 || a == 1 && !cvc(z, z->k - 1)) z->k--;
^
( )
1 warning generated.
compiling porter_wrap.c
linking shared-object stemmer.bundle
clang: error: unknown argument: '-multiply_definedsuppress' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
make: *** [stemmer.bundle] Error 1
make failed, exit code 2
Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/fast-stemmer-1.0.2 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-13/2.0.0/fast-stemmer-1.0.2/gem_make.out
Your problem appeared with Xcode 5.1. In order to avoid many problems related to MacOS' ruby version (this one and many others), you really should use RVM.
If you don't already have it, install Homebrew first: (it is not absolutely necessary, but allows us to install ruby and its dependencies without a looong compilation)
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
Then, the following command will install RVM and the last version of Ruby:
\curl -L https://get.rvm.io | bash -s stable --ruby
Check everything is OK:
ruby --version
You can now install Jekyll:
gem install jekyll
Now, if you really don't want to use RVM, you can execute:
sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install jekyll
But I bet further problems would come.
You should definitely use RVM. Here are the steps:
Uninstall any existing XCode by deleting XCode from Applications folder.
Install Homebrew.
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
Follow additional instructions listed in Homebrew install.
brew doctor
Install RVM.
\curl -L https://get.rvm.io | bash -s stable --ruby
Follow additional instructions upon RVM installation.
source ~/.rvm/scripts/rvm
Install jekyll.
gem install jekyll
Test jekyll.
$ jekyll serve
Configuration file: none
Source: /private/var/log
Destination: /private/var/log/_site
Generating... done.
Server address: ...
Server running... press ctrl-c to stop.
1) xcode-select --install
2) brew install ruby
3) sudo gem install jekyll
4) sudo gem install jekyll-import

Failed to build gem native extension when install RedCloth-4.2.9 install Linux

I want to install Octopress in my computer.
I try to do it like
Octopress document.
When I run
bundle install
I got error message
An error occured while installing RedCloth (4.2.9), and Bundler cannot continue.
Make sure that `gem install RedCloth -v '4.2.9'` succeeds before bundling.
So, I run
sudo gem install RedCloth -v '4.2.9'
then, I got a error message again:
ERROR: Error installing RedCloth:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from extconf.rb:1:in `<main>'
I hadn't learn any knowledge about ruby.
My ubuntu 12.04 solution is install the ruby1.9.1-full version, that can resolve this issue.
sudo apt-get install ruby1.9.1-full
you can execute command:
sudo update-alternatives --config ruby
to select the altiernative ruby which you have installed.
and then, execute below commands to finish the octopress deploy:
git clone https://github.com/erizhang/octopress.git octopress
cd octopress/
sudo gem install bundler
sudo gem install RedCloth -v '4.2.9'
bundle install
rake install
below commands you can find from octopress deploy guideline page:
rake setup_github_pages
sudo rake setup_github_pages
sudo rake generate
sudo rake deploy
Hope it's helpful for you, thanks
I was installing Octopress too and got the same problem as yours. After checking the mkmf.log file I figured out that gcc-4.2 had not been found. I Even installed xcode with the command line tools. It worked when I made a symlink like this:
$ sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2
$ bundle install
I fixed this issue by running
sudo apt-get install ruby-dev
as described in this blog post.
You've probably upgraded to Mountain Lion and have not rebuilt your ruby-1.9.2 install yet with the new development packages.
rvm --force install 1.9.2
gem install bundle --no-ri --no-rdoc
bundle install
If you don't have the Mountain Lion dev packages installed correctly, use the ThoughtBot instructions.
For Ubuntu 14.04 simply do this:
sudo apt-get install ruby1.9.3
Should work for 13.10 and 13.04 too. (Not tested)
it apears you are not using rvm for managing your ruby installation. I think best would be to try rvm, here's a very good guide, you can stop without installing rails: ruby with rvm
Then simply
$gem install RedCloth
Unmanaged ruby gems are a pain, I try to avoid them.
None of the answers worked on my Ubuntu 14.04.1 LTS. Upgrade to ruby 2.0 fixed the problem for me:
sudo apt-get install ruby2.0 ruby2.0-dev
sudo ln -s /usr/bin/ruby2.0 /usr/bin/ruby
sudo ln -s /usr/bin/gem2.0 /usr/bin/gem
sudo gem install bundler
Make sure you also have the build-essential package installed. You can check using
dpkg -l | grep build-essential
or simply install it without checking
sudo apt-get install build-essential
For me on Ubuntu 14.04.1 LTS, after making sure build-essential is installed, the bundle install command works/builds fine also with Ruby 1.9.3.

Resources