I installed CocoaPods and it says Successfully installed cocoapods-0.33.1, but whatever I would try to do with pod command, like pod install, I get the following console output:
Max$ pod install
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin14/rbconfig.rb:213: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
/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>'
I am using Mac OS 10.10 (Yosemite beta version) and Xcode 6.0 beta2, but I think back when I used Mavericks and Xcode 5.1.1 I had the same problem.
I finally solved my problem.
Short answer:
I had to install ruby 2.1.2, then reinstall cocoapods and everything worked.
Long answer:
Resolve all warnings from brew doctor;
remove unused libraries;
remove MacPorts;
resolve additional warnings which I already do not remember;
I might even reinstalled brew.
Install rvm;
Install & use ruby 2.1.2 using rvm;
rvm requirements complains about many missing packages, install them;
among them, there is gcc46, which I was unable to install. After Xcode 4.2 or something, command line tools come without gcc. So if rvm requirements does not find one, it suggests gcc46. But the point is, installing brew install apple-gcc42 solves the problem. rvm requirements stops complaining and you can install ruby 2.1.2:
rvm install 2.1.2;
rvm use 2.1.2;
Install cocoapods, as suggested in #Varsha Vijayvargiya's answer.
I might forgot something, so if you have any questions - ask. Here are some links which helped me:
update mac osx to 10.10 and pod cannot work;
Installing Ruby 2.0.0 with RVM and Homebrew on Mac OS X 10.8 Mountain Lion;
Homebrew GCC won't install on OS X 10.10 Yosemite with Xcode 6;
Installing gcc on Mavericks.
-- Open Xcode 6
-- Open Preferences
-- click on Locations tab
-- Change the Command Line Tools version to Xcode 6.0
-- Uninstall cocoapods
$ sudo gem uninstall cocoapods
-- Install xcodeproj
$ sudo gem install xcodeproj
-- Install cocoapods
$ sudo gem install cocoapods
-- Run pod.
You most probably missed a step, but it's not your fault.
sudo gem install cocoapods
pod setup <–- this is not specified by the doc even though it's vital
pod install
See https://github.com/CocoaPods/CocoaPods/issues/2219
Or check that if you have multi ruby versions in your system:rbenv versions, and try rbenv global 1.9.x to change your ruby version for installing.
First warning says that you've insecure permissions for your bin directory:
local:Documents liuxiaojun$ gem update --system
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin14/rbconfig.rb:213: warning: Insecure world writable dir /usr/bin in PATH, mode 040777
Updating rubygems-update
Successfully installed rubygems-update-2.4.3
Parsing documentation for rubygems-update-2.4.3
Installing RubyGems 2.4.3
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin14/rbconfig.rb:213: warning: Insecure world writable dir /usr/bin in PATH, mode 040777
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin14/rbconfig.rb:213: warning: Insecure world writable dir /usr/bin in PATH, mode 040777
ERROR: While executing gem ... (Errno::EACCES)
Permission denied - /Library/Ruby/Site/2.0.0/gauntlet_rubygems.rb
==========
brew install ruby
OK
First warning says that you've insecure permissions for your bin directory:
warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
See: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
You can fix it via (you need root credentials):
sudo chmod go-w /usr/local/bin
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
my experience: I had the same error after upgrading to Yosemite, I just did a "gem update" and it worked.
Related
I followed the instructions as verbatim on https://github.com/google/EarlGrey/blob/master/docs/install-and-run.md#cocoapods-installation and I when I run pod install, I get:
LoadError - cannot load such file -- earlgrey
/Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:121:in `require'
/Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:121:in `require'
What am I missing?
EarlGrey uses the the earlgrey gem in order to download any Swift or CocoaPods dependencies as stated here in the doc. It seems like the gem wasn't installed correctly.
Remember that gems are installed in /usr/local/bin, which you might need to provide access to. To do so, do sudo gem install earlgrey or sudo gem install -n /usr/local/bin and you should be ready to go!
I'm running exactly the same issue and I couldn't fix it using sudo gem install earlgrey or sudo gem install -n /usr/local/bin. I couldn't find any solution yet - fix doesn't work because of latest update to macOS Sierra (just guessing)?
LoadError - cannot load such file -- earlgrey
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
#edit:
Found a solution.
1. Download and place configure_earlgrey.rb file in the same folder where yours Podfile is.
https://raw.githubusercontent.com/google/EarlGrey/master/gem/lib/earlgrey/configure_earlgrey.rb
2. Replace require 'earlgrey' with load 'configure_earlgrey.rb' in post_install part inside Podfile.
3. Do pod install again.
sudo arch -x86_64 gem install ffi
Then
arch -x86_64 pod install
I am trying to install the fxruby gem, but when I try to require it, I get this error message:
LoadError: cannot load such file -- fox16
from /usr/local/Cellar/ruby/2.0.0 p247/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from /usr/local/Cellar/ruby/2.0.0-p247/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from (irb):2
from /usr/local/Cellar/ruby/2.0.0-p247/bin/irb:12:in `<main>'
I have homebrew, command line tools, and fox installed on my system. I am using ruby 2.0.0 on OS X Mavericks. Any tips?
Not sure if this will help, but
turns out mavericks needs ruby 2.1 (I believe).
try entering these lines
gem source -r https://rubygems.org/
gem source -a http://rubygems.org/
sudo gem install fxruby
Got this information from an update note on this document (same process)
https://www.dropbox.com/s/db3fy100u0kaz63/Creating_an_FXRuby_Build_Environment_in_Lion.rtf
I installed a ruby version as below
$ rvm install ruby-1.9.3-p448-dev
and when i checked version as below
$ ruby -v
ruby 1.9.3p448 (2013-06-27 revision 41675) [i686-linux]
But when i tried to install travis like below
$ gem install travis
Building native extensions. This could take a while...
ERROR: Error installing travis:
ERROR: Failed to build gem native extension.
/home/user/.rvm/rubies/ruby-1.9.3-p448/bin/ruby extconf.rb
/home/user/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/fileutils.rb:1371:in `initialize': Permission denied - /home/user/.travis/travis.sh (Errno::EACCES)
from /home/user/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/fileutils.rb:1371:in `open'
from /home/user/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/fileutils.rb:1371:in `block in copy_file'
from /home/user/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/fileutils.rb:1370:in `open'
from /home/user/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/fileutils.rb:1370:in `copy_file'
from /home/user/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/fileutils.rb:477:in `copy_file'
from /home/user/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/fileutils.rb:396:in `block in cp'
from /home/user/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/fileutils.rb:1515:in `block in fu_each_src_dest'
from /home/user/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/fileutils.rb:1529:in `fu_each_src_dest0'
from /home/user/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/fileutils.rb:1513:in `fu_each_src_dest'
from /home/user/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/fileutils.rb:395:in `cp'
from extconf.rb:5:in `<main>'
Gem files will remain installed in /home/user/.rvm/gems/ruby-1.9.3-p448/gems/travis-1.5.2 for inspection.
Results logged to /home/user/.rvm/gems/ruby-1.9.3-p448/gems/travis-1.5.2/completion/gem_make.out
So how to avoid the above native extensions error and install the travis succesfully using gem
Edit
When i tried the command by including sudo as below
sudo gem install travis
I am getting the below message as success
Building native extensions. This could take a while...
Successfully installed travis-1.5.2
1 gem installed
Installing ri documentation for travis-1.5.2...
Installing RDoc documentation for travis-1.5.2...
And now what all i am trying to do is to set up environ variables on travis
and hence i tried the following command
$ travis encrypt -r travis_uname/app_name EMAIL_HOST_KEY=key_value
and getting the below wierd error
/usr/lib/ruby/vendor_ruby/1.8/rubygems/dependency.rb:247:in `to_specs': Could not find travis (>= 0) amongst [addressable-2.3.5, backports-3.3.3, bundler-1.3.5, bundler-unload-1.0.1, coderay-1.0.9, ethon-0.6.0, faraday-0.8.8, faraday_middleware-0.9.0, ffi-1.9.0, gh-0.11.3, highline-1.6.19, launchy-2.3.0, method_source-0.8.2, mime-types-1.24, multi_json-1.7.9, multipart-post-1.2.0, net-http-persistent-2.9, net-http-pipeline-1.0.1, netrc-0.7.7, pry-0.9.12.2, pusher-client-0.3.1, rake-10.1.0, ruby-hmac-0.4.0, rubygems-bundler-1.2.2, rubygems-update-2.0.7, rvm-1.11.3.8, slop-3.4.6, typhoeus-0.6.4, websocket-1.0.7, websocket-native-1.0.0] (Gem::LoadError)
from /usr/lib/ruby/vendor_ruby/1.8/rubygems/dependency.rb:256:in `to_spec'
from /usr/lib/ruby/vendor_ruby/1.8/rubygems.rb:1208:in `gem'
from /usr/local/bin/travis:18
So finally how to avoid above error and make the above travis command work successfully ?
First of all, set the Ruby version you are using as a default
rvm use --default ruby-1.9.3-p448-dev
and uninstall the gem previously installed with sudo
sudo gem uninstall travis
this makes sure that all your commands are using the same Ruby version and your machine is clean again. Now to your installation problem. This error
Permission denied - /home/user/.travis/travis.sh (Errno::EACCES)
shows you, that the installer tried to access /home/user/.travis but wasn't able to do so due to a lack of user permissions. This means you need to make sure that the folder belongs to you and is writeable
chown -R `whoami` ~/.travis
chmod -R u+wx ~/.travis
Now go ahead and try to re-install:
gem install travis
and everything should be fine.
Installing the -dev packages fixed it for me...
sudo apt-get install ruby-dev
It happens sometimes when you install some gems with sudo and other not.
Ideally you should never sudo for the gem install.
So if you have several gems owned by root and you want to remove the ruby installation and the related gems, run this command:
sudo rvm remove ruby-2.0.0-p353 --gems
rvm remove is the preferred way of removing rubies from rvm. By default, not only will it remove the ruby and it's source files, it will also get rid of aliases, wrappers, environments and any associated binaries - in other words, it cleans up most of the install.
The --gems flag will get rid of all associated gemsets.
The you should reinstall your ruby version with:
rvm install ruby-2.0.0-p353
and bundle install again.
I'm using Postgres.app on OS X (10.8.3). I have modified my PATH so that the bin folder for the app is before all others.
Rammy:~ phrogz$ which pg_config
/Applications/Postgres.app/Contents/MacOS/bin/pg_config
I have rvm installed and can install the pg gem without error, but when I go to require it I get an error:
Rammy:~ phrogz$ gem -v
1.8.25
Rammy:~ phrogz$ gem install pg
Fetching: pg-0.15.1.gem (100%)
Building native extensions. This could take a while...
Successfully installed pg-0.15.1
1 gem installed
Rammy:~ phrogz$ ruby -v -e "require 'pg'"
ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-darwin12.3.0]
/Users/phrogz/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': dlopen(/Users/phrogz/.rvm/gems/ruby-1.9.3-p392/gems/pg-0.15.1/lib/pg_ext.bundle, 9): Library not loaded: #executable_path/../lib/libssl.1.0.0.dylib (LoadError)
Referenced from: /Applications/Postgres.app/Contents/MacOS/lib/libpq.dylib
Reason: image not found - /Users/phrogz/.rvm/gems/ruby-1.9.3-p392/gems/pg-0.15.1/lib/pg_ext.bundle
from /Users/phrogz/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/phrogz/.rvm/gems/ruby-1.9.3-p392/gems/pg-0.15.1/lib/pg.rb:4:in `<top (required)>'
from /Users/phrogz/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `require'
from /Users/phrogz/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
from /Users/phrogz/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
from -e:1:in `<main>'
What do I need to do to get the pg gem properly installed?
Edit: Even though this answer currently has more votes than the accepted answer, the accepted answer is far simpler and cleaner.
Remove the Postgres.app binaries from the path when installing the pg gem, and instead use the postgres install built into OS X to configure the gem. The pg library will still correctly connect to the Postgres.app server later on.
Rammy:~ phrogz$ gem uninstall pg
Successfully uninstalled pg-0.15.1
# Modify PATH to remove /Applications/Postgres.app/Contents/MacOS/bin
Rammy:~ phrogz$ gem install pg
Fetching: pg-0.15.1.gem (100%)
Building native extensions. This could take a while...
Successfully installed pg-0.15.1
1 gem installed
Rammy:~ phrogz$ ruby -v -e "require 'pg'"
ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-darwin12.3.0]
I found a solution that works for me and requires minimal hacking/configuring. You only need to do this once and it will work for every bundle install. Add the following to your .bash_profile, .bash_rc, or equivalent:
export DYLD_FALLBACK_LIBRARY_PATH=/Applications/Postgres.app/Contents/MacOS/lib:$DYLD_LIBRARY_PATH
(Assuming you installed Postgres.app in the default location). Then restart your terminal session and try again.
Exporting to DYLD_LIBRARY_PATH directly can cause serious problems with other apps that depend on it, but using the fallback path avoids these problems.
See also:
https://github.com/PostgresApp/PostgresApp/issues/109#issuecomment-18387546
Postgres.app upgrade, now Rails app won't start
EDIT: It seems that setting DYLD_FALLBACK_LIBRARY_PATH causes an error when you try to run psql. To fix this, you can add the following two lines to your .bash_profile:
alias psql="(. ~/.bash_profile; unset DYLD_FALLBACK_LIBRARY_PATH; psql)";
This is assuming that you're using bash and that your .bash_profile is located in your home directory. If that's not the case (or if you're using a .bashrc or other environment setup instead of .bash_profile) change the ~/.bash_profile part of the command to the path to your environment setup script.
The aliased commands basically start a subshell which does not effect your current bash environment. So when it unsets the DYLD_FALLBACK_LIBRARY_PATH variable, it's only temporary. After you exit psql the environment variable will be set again so that rails functions properly.
This worked for me:
sudo env ARCHFLAGS="-arch x86_64" gem install pg -- --with-pg-config=/Applications/Postgres93.app/Contents/MacOS/bin/pg_config
Just double check that the /Applications/Postgres93.app.. path exists for you.
The problem is in the linking of the gem to the Postgres.app.
If you link it to the postgres version that ships with osx
Here's a small script:
if using rvm with project gemsets: change into your project
run the following commands:
gem uninstall pg
PATH=${PATH/'Postgres.app'/'WRONGFOLDER.app'}
gem install pg
PATH=${PATH/'WRONGFOLDER.app'/'Postgres.app'}
Now everthing should be fine
TL;DR:
$ gem install rubyzip
ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted - /Users/darth/.rvm/gems/ruby-1.9.2-p136/gems/rubyzip-0.9.4/README
And now in detail. I'm not sure which information is relevant, so I'm just gonna say it all.
I recently upgraded from OS X Snow Leopard to Lion (also upgraded Xcode to 4.2)
Everything worked just fine for a while
Today I decided to install some gems (RSpec, Cucumber), and I started getting date format warnings whenever I did anything with RubyGems
I decided to update RubyGems, from 1.3.6 (I'm not sure here) to current 1.8.11
The warning kept on popping up, so I tried to remove the gemset with rvm gemset empty, which also failed, because of some permission denied error (yes stupid me didn't write it down)
In result of that, I reinstalled Ruby via rvm remove 1.9.2 and rvm install 1.9.2 (I didn't forget to rvm use 1.9.2 --default after that.
I installed bundler gem install bundle and then tried to bundle install in my Rails 3.1.1 project, but it ends with error
Installing rubyzip (0.9.4)
Errno::EPERM: Operation not permitted - /Users/darth/.rvm/gems/ruby-1.9.2-p136/gems/rubyzip-0.9.4/README
An error occured while installing rubyzip (0.9.4), and Bundler cannot continue.
Make sure that `gem install rubyzip -v '0.9.4'` succeeds before bundling.
gem install rubyzip -v '0.9.4' gives the above mentioned error
The README file says to download source and install from there via ruby install.rb, which also ends in error
$ ruby install.rb
/Users/darth/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/fileutils.rb:841:in `install': wrong number of arguments (4 for 3) (ArgumentError)
from install.rb:21:in `block in <main>'
from install.rb:18:in `each'
from install.rb:18:in `<main>'
Even executing tests fro rubyzip ends up in bunch of errors
$ rake test
rake/gempackagetask is deprecated. Use rubygems/package_task instead
rake/rdoctask is deprecated. Use rdoc/task instead (in RDoc 2.4.2+)
/Users/darth/.rvm/rubies/ruby-1.9.2-p136/bin/ruby -C test alltests.rb
<internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- stdrubyexttest (LoadError)
from <internal:lib/rubygems/custom_require>:29:in `require'
from alltests.rb:5:in `<main>'
rake aborted!
Command failed with status (1): [/Users/darth/.rvm/rubies/ruby-1.9.2-p136/b...]
Tasks: TOP => test
(See full trace by running task with --trace)
I'm out of ideas, what can I do?
I'm really not sure what caused this, but I managed to fix it by doing the following.
Since reinstalling Ruby 1.9.2 didn't help, I decided to be even more drastical and went down to rvm. I found out that I had version 1.1.something installed, which is about 9 months old.
I tried to update, but it didn't help, so rvm implode did the trick. I even had to sudo rm -rf ~/.rvm, probably because I managed to mess up some gem installs by adding sudo to them.
After reinstalling rvm and reinstalling 1.9.2, it seems like everything is working fine now, even with Xcode 4.2.
Lesson learned, rm -rf & reinstall is better than trying to upgrade from a year old version :)