very stuck with cocoapods / ruby setup - cocoapods

This was working fine and then suddenly it wasn't. I wish i knew why. Really stuck and cannot find anything online. I'm working on an ObjectiveC project. I've tried reseting everything with:
$ sudo gem uninstall ruby
$ sudo gem uninstall cocoapods
then
$ sudo gem install ruby
$ sudo gem install cocoapods
$ sudo gem update ruby
$ sudo gem update cocoapods
then i when in my projects directory i run
$pod install
and get the following error. I get this on all projects.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:110:in `require': cannot load such file -- cocoapods-core (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:110:in `rescue in require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:35:in `require'
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/lib/cocoapods.rb:8:in `<module:Pod>'
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/lib/cocoapods.rb:4:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/bin/pod:23:in `<top (required)>'
from /usr/bin/pod:23:in `load'
from /usr/bin/pod:23:in `<main>'
Any ideas/clues/answers would be very appreciated.

I reinstalled cocoa pods by running
$ sudo gem uninstall cocoapods-core cocoapods-downloader cocoapods
$ sudo gem install cocoapods
That resolved the issue for me

Looks like you're missing one of CocoaPod's dependencies. You should be able to install it with:
[sudo] gem install cocoapods-core

You should stop using "sudo" for tasks such as "gem install" etc. Here is a little tutorial on how to fix your ruby to ensure that you are not going to see issues with permissions for cocoapods (and other gems):
Can't get to work CocoaPods and Yosemite

Related

cannot load such file -- rubygems/core_ext/kernel_warn (LoadError)

on a mac os 10.12.6 after i try sudo gem install rake or
i get this error message:
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- rubygems/core_ext/kernel_warn (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Library/Ruby/Site/2.0.0/rubygems.rb:1395:in `<top (required)>'
from <internal:gem_prelude>:1:in `require'
from <internal:gem_prelude>:1:in `<compiled>'
The is error throws any gem install
Ruby version is 2.0.0, Ive tried updating ruby with homebrew but whni try installing home brew i get the same error.
Cant seem to edit /Library/Ruby/Site/2.0.0/rubygems.rb:1395
This is possibly related to issue #2535 in rubygems fixed in release 3.0.1.
Try gem update --system
All suggested solutions didn't fully work for me, although gem update --system seems to be a good idea, because it updates ruby. BUT: On my Mac, the system version didn't step back after the update, although ruby -v gave the correct new version. The described error remained for me, e.g. while using homebrew with brew update:
$ brew update
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- rubygems/core_ext/kernel_warn (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Library/Ruby/Site/2.3.0/rubygems.rb:1395:in `<top (required)>'
from <internal:gem_prelude>:4:in `require'
from <internal:gem_prelude>:4:in `<internal:gem_prelude>'
The only thing that helped me was the following as described here:
sudo rm -f '/usr/local/bin/update_rubygems'
sudo rm -rf '/Library/Ruby/Site/2.3.0'
Hope to help some folks (I'am on MacOS 10.14.2).
You are going to have problems using system ruby or messing with it's gems. You are far better off to use a ruby version manager where you may have different versions of ruby per project. I highly recommend RVM.
See here for how to install
Did you also try to run gem install bundler?
Post output of these commands if they don't give you an error
ruby -v
which ruby
gem env

compass fails on arch

Running grunt serve which use to work I'm having this error message.
Running "compass:server" (compass) task
Warning: Command failed: compass --version
/usr/lib/ruby/gems/2.4.0/gems/bundler-1.13.7/lib/bundler/definition.rb:179:in `rescue in specs': Your bundle is locked to chunky_png (1.3.4), but that version could not be found in any of the sources listed in your Gemfile. If you haven't changed sources, that means the author of chunky_png (1.3.4) has removed it. You'll need to update your bundle to a different version of chunky_png (1.3.4) that hasn't been removed in order to install. (Bundler::GemNotFound)
from /usr/lib/ruby/gems/2.4.0/gems/bundler-1.13.7/lib/bundler/definition.rb:173:in `specs'
from /usr/lib/ruby/gems/2.4.0/gems/bundler-1.13.7/lib/bundler/definition.rb:233:in `specs_for'
from /usr/lib/ruby/gems/2.4.0/gems/bundler-1.13.7/lib/bundler/definition.rb:222:in `requested_specs'
from /usr/lib/ruby/gems/2.4.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:118:in `block in definition_method'
from /usr/lib/ruby/gems/2.4.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:19:in `setup'
from /usr/lib/ruby/gems/2.4.0/gems/bundler-1.13.7/lib/bundler.rb:99:in `setup'
from /usr/lib/ruby/gems/2.4.0/gems/bundler-1.13.7/lib/bundler/setup.rb:20:in `<top (required)>'
from /usr/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:133:in `require'
from /usr/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:133:in `rescue in require'
from /usr/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:40:in `require'
from /usr/bin/compass:6:in `<main>'
So on side I ran a compass --version and I obtain the same error Your bundle is locked to chunky_png (1.3.4), etc.
Trying to bundle install seems a bit useless...
$ bundle install
Could not locate Gemfile or .bundle/ directory
So I tried to reinstall ruby-compass because which compass sent me to /usr/bin/compass which is the one set by ruby-compass AUR package.
that did'nt solved the problem. Any idea around ?
solved by installing compass via pacgem
details of commands :
to install pacgem
cd ~/devel/aur.archlinux.org/ # or where ever you used to put your AUR
git clone https://aur.archlinux.org/pacgem.git
cd pacgem
cat PKGBUILD # at this point, it is recommended to personally check to PKGBUILD
makepkg -si
and answer y to all questions
install compass
pacgem compass
and answer y to all questions. It will install needed dependencies.

Cannot build or serve Jekyll site on OSX

I am running OS X 10.11.6 and I installed Jekyll (using the already existent ruby on my system) by the recommended method: sudo gem install -n /usr/local/bin/ jekyll.
I can happily run jekyll on my system so I made a new site by running jekyll new TestSite which successfully executed.
However, this is where it stops working: if I cd into the site directory and run any jekyll command I get the following error:
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- bundler (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-3.2.1/lib/jekyll/plugin_manager.rb:34:in `require_from_bundler'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-3.2.1/exe/jekyll:9:in `<top (required)>'
from /usr/local/bin/jekyll:23:in `load'
from /usr/local/bin/jekyll:23:in `<main>'
Any ideas how to get it working?
It seems you don't have bundler gem. Try
gem install bundler

ta-lib gem not installing dependencies?

I am trying to run a simple example script from here, but even after installing requisite gems with no errors I get an error when running the script. It looks like libta_lib.so cant be found, but nothing in the install commands below had an error. Any idea what I am missing? Im happy to provide more data if needed, I just dont know what would be useful.
I ran:
#compiling ta-lib from source
gem uninstall talib_ruby
gem uninstall ta-indicator
make clean
sudo ./configure LDFLAGS="-lm"
sudo make
sudo make install
gem install talib_ruby
gem install ta-indicator
king#death-star ~/Desktop/_REPOS/misc/stock_analysis/forex/oanda/ruby $ ruby -e "require 'talib_ruby'; l = TaLib::Function.new('MA') "
/home/king/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': libta_lib.so.0: cannot open shared object file: No such file or directory - /home/king/.rvm/gems/ruby-2.3.0/gems/talib_ruby-1.0.6/lib/talib.so (LoadError)
from /home/king/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/king/.rvm/gems/ruby-2.3.0/gems/talib_ruby-1.0.6/lib/talib_ruby.rb:5:in `<top (required)>'
from /home/king/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `require'
from /home/king/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `rescue in require'
from /home/king/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:40:in `require'
from -e:1:in `<main>'
As per this follow these steps
sudo gedit /etc/ld.so.conf
Append below line and save:
include /usr/local/lib
run sudo /sbin/ldconfig

Can't get to work CocoaPods and Yosemite

I already tried this steps:
Open Xcode 6 Open Preferences
Click the Locations tab
Change the Command Line Tools version to Xcode 6.0
Uninstall cocoapods
a. $sudo gem uninstall cocoapods Install xcodeproj
a. $ sudo gem install
xcodeproj Install cocoapods
a. $ sudo gem install cocoapods
Run pod --version to verify that it worked
But I'm still gettings this when I do pod install or pod --version:
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- xcodeproj/prebuilt/universal.x86_64-darwin14-2.0.0/xcodeproj_ext (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Library/Ruby/Gems/2.0.0/gems/xcodeproj-0.17.0/lib/xcodeproj/ext.rb:6:in `rescue in <top (required)>'
from /Library/Ruby/Gems/2.0.0/gems/xcodeproj-0.17.0/lib/xcodeproj/ext.rb:3:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Library/Ruby/Gems/2.0.0/gems/xcodeproj-0.17.0/lib/xcodeproj.rb:30:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.33.1/lib/cocoapods.rb:2:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.33.1/bin/pod:32:in `<top (required)>'
from /usr/bin/pod:23:in `load'
from /usr/bin/pod:23:in `<main>'
In case someone else got the same issue, I did this to fix my issue:
Update Gems
sudo gem update --system
Uninstalled xcodeproj
sudo gem uninstall xcodeproj
Make sure to select All versions
Uninstalled Cocoapods
sudo gem uninstall cocoapods
Install xcodeproj
sudo gem install xcodeproj
Install cocoapods
sudo gem install cocoapods
Run
pod --version to test.
Running these 2 lines will resolve your problem
sudo gem update --system
sudo gem install cocoapods
I had to uninstall the entire dependency chain for cocoapods to get it to work.
for i in `gem list --no-versions`; do gem uninstall -aIx $i; done
see Uninstall all installed gems, in OSX?
Many of this issues are because of system-wide ruby installation and it forces developers to use "sudo" all the time (well, how many times we did "sudo gem install cocoapods --pre"). I recently had the same issue trying to install a pre-released version of cocoapods (permissions were messed up). So here is a approached that worked for me.
$ sudo gem uninstall xcodeproj
$ sudo gem uninstall cocoapods
# Let's restore Apple's ruby installation, the following is for Yosemite that has 2.0 ruby by default
$ cd /System/Library/Frameworks/Ruby.framework/Versions
$ sudo rm Current
$ sudo ln -s 2.0 Current
$ brew install ruby
(closing and opening terminal window sometimes help)
$ which ruby
should display /usr/local/bin/ruby
(should point to "local" directory now, not to "/usr/bin", if this is not the case for you, make sure to modify path order)
Now you should be able to install xcodeproj and cocoapods without using "sudo":
$ gem install xcodeproj --pre
$ gem install cocoapods --pre
(I'm using pre-released version, just remove --pre if you want to use releases instead).
Enjoy :)
The error 'require': cannot load such file indicates that you some missing or broken gem package. You can probably fix it by re-installing cocoapods:
gem uninstall cocoapods # Follow by sudo if necessary
gem install cocoapods --verbose # Follow by sudo if necessary
And make sure that your xcodeproj is present:
gem install xcodeproj --verbose # Follow by sudo if necessary
If won't help, try to install it by using older Ruby:
sudo ln -s /Library/Ruby/Gems/1.8/gems/rubygems-update-1.8.12/bin/gem /usr/bin/gem18
sudo gem18 install cocoapods
See:
Managing Rails Versions and Gems
You just have to execute this commande before :
sudo gem install cocoapods
This will update all outdated gems

Resources