Pod 'cannot load such file' after delete and re-install - ruby

I had some major problems with my project after adding some pods to my Pod file and running pod install.
I tried to fix it after reading some SO questions, when nothing worked i deleted cocoa pods and re installed it using this answer: Pod delete
After doing that, No matter which pod command i try to execute i always get this error message:
admin$ pod --version
/usr/bin/pod:23:in `load': cannot load such file -- /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.37.1/bin/pod (LoadError)
from /usr/bin/pod:23:in `<main>'
But when i try to list the files this is the result:
admin$ gem list --local | grep cocoapods
cocoapods (1.0.0)
cocoapods-clean (0.0.1)
cocoapods-core (1.0.0)
cocoapods-deintegrate (1.0.0)
cocoapods-downloader (1.0.0)
cocoapods-plugins (1.0.0)
cocoapods-search (1.0.0)
cocoapods-stats (1.0.0)
cocoapods-trunk (1.0.0)
cocoapods-try (1.0.0)
What am i missing over here?

Related

bundle exec pod install -> Failed to find known source with the URL "trunk"

I'm following some instructions left behind for an Xcode repository.
$ bundle exec pod install
Analyzing dependencies
[!] The version of CocoaPods used to generate the lockfile (1.9.3) is higher than the version of the \
current executable (1.6.1). Incompatibility issues may arise.
I think this leads to the error:
Failed to find known source with the URL "trunk"
When I check the version of pods, I get:
$ pod --version
1.10.0
My assumption (but I could be wrong), is that I either need to run the command to it runs the newer version of pod, or I need to install the newer version in a different place.
Added info
(per comment's request)
$ gem list pod
*** LOCAL GEMS ***
cocoapods (1.10.1, 1.10.0)
cocoapods-core (1.10.1, 1.10.0)
cocoapods-deintegrate (1.0.4)
cocoapods-downloader (1.4.0)
cocoapods-plugins (1.0.0)
cocoapods-search (1.0.0)
cocoapods-trunk (1.5.0)
cocoapods-try (1.2.0)
$ grep -i pod Gemfile.lock
cocoapods (1.6.1)
cocoapods-core (= 1.6.1)
cocoapods-deintegrate (>= 1.0.2, < 2.0)
cocoapods-downloader (>= 1.2.2, < 2.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
cocoapods-search (>= 1.0.0, < 2.0)
cocoapods-stats (>= 1.0.0, < 2.0)
cocoapods-trunk (>= 1.3.1, < 2.0)
cocoapods-try (>= 1.1.0, < 2.0)
cocoapods-core (1.6.1)
cocoapods-deintegrate (1.0.4)
cocoapods-downloader (1.2.2)
cocoapods-plugins (1.0.0)
cocoapods-search (1.0.0)
cocoapods-stats (1.1.0)
cocoapods-trunk (1.3.1)
cocoapods-try (1.1.0)
cocoapods
I've run into this issue multiple times, not sure why though. To fix I run the following terminal commands in the project directory:
sudo gem install cocoapods-deintegrate cocoapods-clean (ONLY if you do not have cocoapods-deintegrate and cocoapods-clean installed)
pod deintegrate
pod clean
pod setup
pod install
From my understanding this will completely clear and reinstall the pod files. Again I am not sure what causes the issue to start with, but this works for me.

Ruby bundler installing unwanted version of puppet gem

I have the following script
PUPPET_VERSION=3.7.4
ruby='1.8.7-p374'
rvm use $ruby#$$ --create
gem install bundler
bundle install --gemfile=.gemfile
This has worked for several months but sadly now it has decided to stop working.
After this script rake is called to run some rspec tasks
On the centos 6.6 bamboo test runner the process fails.
On the centos 6.4 development machine it still works
On my development machine this script (+rake tasks ) works like so
Fetching gem metadata from http://rubygems.org/.........
Fetching version metadata from http://rubygems.org/..
Installing rake 10.4.2
Installing CFPropertyList 2.2.8
Installing builder 3.2.2
Installing diff-lcs 1.2.5
Installing facter 2.4.1
Installing json_pure 1.8.2
Installing hiera 1.3.4
Installing metaclass 0.0.4
Installing mocha 1.1.0
Installing puppet 3.7.4
Installing puppet-lint 1.1.0
Installing puppet-syntax 1.4.1
Installing rspec-core 2.99.2
Installing rspec-expectations 2.99.2
Installing rspec-mocks 2.99.3
Installing rspec 2.99.0
Installing rspec-puppet 2.0.0
Installing puppetlabs_spec_helper 0.8.2
Installing rspec_junit_formatter 0.2.0
Using bundler 1.9.4
Bundle complete! 3 Gemfile dependencies, 20 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
manifests found
~/gitf/puppetmaster_np/local_modules/iop_4store/spec/fixtures/modules ~/gitf/puppetmaster_np/local_modules/iop_4store
~/gitf/puppetmaster_np/local_modules/iop_4store
/home/jan/.rvm/rubies/ruby-1.9.3-p484/bin/ruby -S rspec ./spec/classes/iop_4store_spec.rb --no-drb -r rspec_junit_formatter --format RspecJunitFormatter -o junit.xml --deprecation-out /dev/null
WARN: Unresolved specs during Gem::Specification.reset:
rake (>= 0)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
Removing gemset 16612......
However on the bamboo agent node it does this
The source :rubygems is deprecated because HTTP requests are insecure.
Please change your source to 'https://rubygems.org' if possible, or 'http://rubygems.org' if not.
Using rake 10.4.2
Using CFPropertyList 2.2.8
Using builder 3.2.2
Using diff-lcs 1.2.5
Using facter 2.4.3
Using json_pure 1.8.2
Using hiera 2.0.0
Using metaclass 0.0.4
Using mocha 1.1.0
Using puppet 4.0.0
Using puppet-lint 1.1.0
Using puppet-syntax 2.0.0
Using rspec-support 3.2.2
Using rspec-core 3.2.3
Using rspec-expectations 3.2.1
Using rspec-mocks 3.2.1
Using rspec 3.2.0
Using rspec-puppet 2.0.1
Using puppetlabs_spec_helper 0.10.2
Using rspec_junit_formatter 0.2.0
Using bundler 1.9.4
Bundle complete! 3 Gemfile dependencies, 21 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
manifests found
~/bamboo-agent-home/xml-data/build-dir/PUP-RCTAP-JOB1/local_modules/iop_4store/spec/fixtures/modules ~/bamboo-agent-home/xml-data/build-dir/PUP-RCTAP-JOB1/local_modules/iop_4store
~/bamboo-agent-home/xml-data/build-dir/PUP-RCTAP-JOB1/local_modules/iop_4store
/usr/local/rvm/rubies/ruby-1.9.3-p484/bin/ruby -I/usr/local/rvm/gems/ruby-1.9.3-p484/gems/rspec-support-3.2.2/lib:/usr/local/rvm/gems/ruby-1.9.3-p484/gems/rspec-core-3.2.3/lib /usr/local/rvm/gems/ruby-1.9.3-p484/gems/rspec-core-3.2.3/exe/rspec --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb --no-drb -r rspec_junit_formatter --format RspecJunitFormatter -o junit.xml --deprecation-out /dev/null
WARN: Unresolved specs during Gem::Specification.reset:
rake (>= 0)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
/usr/local/rvm/gems/ruby-1.9.3-p484/gems/puppetlabs_spec_helper-0.10.2/lib/puppetlabs_spec_helper/module_spec_helper.rb:23:in `block in <top (required)>': undefined method `environmentpath=' for #<RSpec::Core::Configuration:0x000000025a4068> (NoMethodError)
from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/rspec-core-3.2.3/lib/rspec/core.rb:101:in `configure'
from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/puppetlabs_spec_helper-0.10.2/lib/puppetlabs_spec_helper/module_spec_helper.rb:22:in `<top (required)>'
from /usr/local/rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:135:in `require'
from /usr/local/rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:135:in `rescue in require'
from /usr/local/rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:144:in `require'
from /home/bamboo/bamboo-agent-home/xml-data/build-dir/PUP-RCTAP-JOB1/local_modules/iop_4store/spec/spec_helper.rb:2:in `<top (required)>'
from /usr/local/rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/bamboo/bamboo-agent-home/xml-data/build-dir/PUP-RCTAP-JOB1/local_modules/iop_4store/spec/classes/iop_4store_spec.rb:1:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1226:in `load'
from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1226:in `block in load_spec_files'
from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1224:in `each'
from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1224:in `load_spec_files'
from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:97:in `setup'
from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:85:in `run'
from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:70:in `run'
from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:38:in `invoke'
from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/rspec-core-3.2.3/exe/rspec:4:in `<main>'
/usr/local/rvm/rubies/ruby-1.9.3-p484/bin/ruby -I/usr/local/rvm/gems/ruby-1.9.3-p484/gems/rspec-support-3.2.2/lib:/usr/local/rvm/gems/ruby-1.9.3-p484/gems/rspec-core-3.2.3/lib /usr/local/rvm/gems/ruby-1.9.3-p484/gems/rspec-core-3.2.3/exe/rspec --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb --no-drb -r rspec_junit_formatter --format RspecJunitFormatter -o junit.xml --deprecation-out /dev/null failed
/usr/local/rvm/gems/ruby-1.9.3-p484#27314 did not previously exist. Ignoring.
The tests fail and I'm sure that having a wildly different version of puppet (and other gems) is not helping. Also, our systems aren't running puppet 4
Here is the gemfile that is being used
source :rubygems
puppetversion = ENV.key?('PUPPET_VERSION') ? "= #{ENV['PUPPET_VERSION']}" : ['>=
2.7']
gem 'puppet', puppetversion
gem 'puppetlabs_spec_helper', '>= 0.1.0'
gem 'rspec_junit_formatter'
So my problem is that the scripts shown previously loaded the correct gems into rvm and executed the tests "as if" puppet 3.7.0. Now they try and load puppet 4 and the tests fail.
Thanks
Here's what I did to "make it work" Not entirely sure why this fixed it
First, alter the gemfile to copy most of the versions of the gem dependencies from the other server where it still works
source 'https://rubygems.org'
puppetversion = ENV.key?('PUPPET_VERSION') ? "= #{ENV['PUPPET_VERSION']}" : ['>=
2.7', '< 4.0']
gem 'diff-lcs', '1.2.5'
gem 'facter'
gem 'hiera', '1.3.4'
gem 'json_pure', '1.8.2'
gem 'metaclass', '0.0.4'
gem 'mocha', '1.1.0'
gem 'puppet', puppetversion
gem 'puppet-lint', '1.1.0'
gem 'puppet-syntax', '1.4.1'
gem 'puppetlabs_spec_helper', '0.8.2'
gem 'rake'
gem 'rspec', '2.99.0'
gem 'rspec-core', '2.99.2'
gem 'rspec-expectations', '2.99.2'
gem 'rspec-mocks', '2.99.3'
gem 'rspec-puppet', '2.0.0'
gem 'rspec_junit_formatter', '0.2.0'
Next, add a couple of "bundle update" and a "bundlee clean --force" to the script.
PUPPET_VERSION=3.7.4
ruby='1.9.3-p484'
rvm use $ruby#$$ --create
gem install bundler
ln -s .gemfile Gemfile
bundle clean --force
bundle update rspec
bundle install --gemfile=.gemfile
bundle update rspec
(the eagle eyed will note that I'm running a different ruby too)

Failure at "bundle-install"

I am trying to work on a new project on Ubuntu. After cloning the GitHub repo and installing ruby sudo apt-get install ruby, y perform
bundle install
and I get this feedback:
$ bundle install
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Using rake (10.0.4)
Using coderay (1.0.9)
Using coffee-script-source (1.6.2)
Using multi_json (1.7.2)
Using execjs (1.4.0)
Using coffee-script (2.2.0)
Installing ffi (1.8.1)
Gem::Installer::ExtensionBuildError: 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:4:in `<main>'
Gem files will remain installed in /home/dbugger/.bundler/tmp/24874/gems/ffi-1.8.1 for inspection.
Results logged to /home/dbugger/.bundler/tmp/24874/gems/ffi-1.8.1/ext/ffi_c/gem_make.out
An error occurred while installing ffi (1.8.1), and Bundler cannot continue.
Make sure that `gem install ffi -v '1.8.1'` succeeds before bundling.
What am I missing?
Try sudo apt-get install ruby1.9-dev.
Then bundle install again.
As an aside you probably want to not mess with the system ruby and install ruby locally instead with rbenv or rvm.

make fails during install of json-1.8.0 with unrecognized option '-arch' on OSX 10.8.4

I am trying to get my ruby environment properly setup, but keep receiving errors when attempting to bundle install my test app.
I first get an error when trying to bundle install:
$ rails new app
// [...]
run bundle install
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Using rake (10.1.0)
Using i18n (0.6.5)
Using multi_json (1.7.9)
Using activesupport (3.2.9)
Using builder (3.0.4)
Using activemodel (3.2.9)
Using erubis (2.7.0)
Using journey (1.0.4)
Using rack (1.4.5)
Using rack-cache (1.2)
Using rack-test (0.6.2)
Using hike (1.2.3)
Using tilt (1.4.1)
Using sprockets (2.2.2)
Using actionpack (3.2.9)
Using mime-types (1.23)
Using polyglot (0.3.3)
Using treetop (1.4.14)
Using mail (2.4.4)
Using actionmailer (3.2.9)
Using arel (3.0.2)
Using tzinfo (0.3.37)
Using activerecord (3.2.9)
Using activeresource (3.2.9)
Using bundler (1.3.5)
Using coffee-script-source (1.6.3)
Using execjs (1.4.0)
Using coffee-script (2.2.0)
Using rack-ssl (1.3.3)
Installing json (1.8.0)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/ryan/.rvm/rubies/ruby-1.9.3-p327/bin/ruby extconf.rb
creating Makefile
make
compiling generator.c
gcc-4.6: error: x86_64: No such file or directory
gcc-4.6: error: unrecognized option '-arch'
make: *** [generator.o] Error 1
Gem files will remain installed in /Users/ryan/.rvm/gems/ruby-1.9.3-p327/gems/json-1.8.0 for inspection.
Results logged to /Users/ryan/.rvm/gems/ruby-1.9.3-p327/gems/json-1.8.0/ext/json/ext/generator/gem_make.out
An error occurred while installing json (1.8.0), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.0'` succeeds before bundling.
Following the last line of the error message I attempt to gem install json -v '1.8.0' but get the following:
Building native extensions. This could take a while...
ERROR: Error installing json:
ERROR: Failed to build gem native extension.
/Users/ryan/.rvm/rubies/ruby-1.9.3-p327/bin/ruby extconf.rb
creating Makefile
make
compiling generator.c
gcc-4.6: error: x86_64: No such file or directory
gcc-4.6: error: unrecognized option '-arch'
make: *** [generator.o] Error 1
Gem files will remain installed in /Users/ryan/.rvm/gems/ruby-1.9.3-p327/gems/json-1.8.0 for inspection.
Results logged to /Users/ryan/.rvm/gems/ruby-1.9.3-p327/gems/json-1.8.0/ext/json/ext/generator/gem_make.out
Any help would be greatly appreciated... I currently using the following versions of rvm, ruby + rails:
$ ruby -v
ruby 1.9.3p327 (2012-11-10) [x86_64-darwin12.2.0]
$ rails -v
Rails 3.2.9
$ rvm -v
rvm 1.22.1 (stable) by Wayne E. Seguin <wayneeseguin#gmail.com>, Michal Papis <mpapis#gmail.com> [https://rvm.io/]
Please let me know if you need any other information.
sounds like this can be caused by binary ruby, try:
rvm get head
rvm reinstall 1.9.3-p327 --disable-binary
delete gemfile.lock and run bundle
If you have rvm installed, this should work:
rvm reinstall 2.0.0-p247 --disable-binary
If you just updated OS X, you might want to try some other things first. See thoughtbot's guide.
I had this problem, I decided to changing the default version of Ruby for 1.9.3p327.
Leaving the project folder and making the command:
rvm use 1.9.3-P327 --default
I do not know why this, for rvm modifies the version within the project, but after doing it gave no error when doing the 'bundle install'
I think you should set correct version your rvm. for example if your developed your application in ruby 1.9.3, you should set
"rvm use 1.9.3". Then you can enter "bundle install" command. Maybe this will help you.
Thanks

Installing Webistrano on Debian squeeze 64bits

I'm currently trying to install Webistrano on a freshly installed debian squeeze 64bits, but I'm facing some issues that I can't manage to solve.
Note: The machine is created under Xen environment, I don't think this affect the procedure however it seemed important to mention it.
Procedure:
Informations:
Ruby version: ruby 1.8.7 (2010-08-16 patchlevel 302) [x86_64-linux]
Rails version: `Rails 2.3.11
Path modifier with: /usr/lib/ruby/1.8:/var/lib/gems/1.8/bin
Rails env: development
Databases have been created
Databases setups for webistrano are, I believe correct (user/pass/path_to_sock_file)
So, here is what I did:
I first installed the 'basics' packages for such installation:
# apt-get install build-essential ruby rubygems libmysql-ruby libmysqlclient-dev libdbd-mysql-ruby mysql-server unzip rake
Then I have been downloading and extracting the project into /usr/src. After copying and configuring the files for email/databses setups (as suggested by https://github.com/peritor/webistrano), I continued by installing all the gems needed for the project:
bundle install
at this point, the command is stuck and isn't doing anything for an hour.
I know it can happen if the Gemfile is complicate, but it doesn't seem to be the case for me. (see the Gemfile following)
# cat Gemfile
source "http://rubygems.org"
gem 'bundler', "~>1.0.10"
gem "rails", "2.3.11"
gem "mysql"
gem "erubis"
gem "rake"
gem "syntax", "1.0.0"
gem "capistrano", "2.6.0"
gem "open4", "0.9.3"
gem "exception_notification", "2.3.3.0"
group :test do
gem "mocha", "0.9.8"
end
So deciding to go ahead I installed the gems by hands, which once finished gives:
# gem list *gems of Gemfile*
bundler (1.0.10)
rails (2.3.11)
mysql (2.8.1)
erubis (2.7.0)
rake (0.9.2.2)
syntax (1.0.0)
capistrano (2.6.0)
open4 (0.9.3)
exception_notification (2.3.3.0)
mocha (0.9.8)
So I believe everything should be working without having to run: bundle install
This is why I finally tried to create the database's structure with rake:
# rake db:migrate --trace
(in /usr/src/peritor-webistrano-a98ba6b)
rake aborted!
Bundler couldn't find some gems.Did you run `bundle install`?
/usr/src/peritor-webistrano-a98ba6b/config/../config/preinitializer.rb:18
/usr/src/peritor-webistrano-a98ba6b/config/boot.rb:28:in `load'
/usr/src/peritor-webistrano-a98ba6b/config/boot.rb:28:in `preinitialize'
/usr/src/peritor-webistrano-a98ba6b/config/boot.rb:10:in `boot!'
/usr/src/peritor-webistrano-a98ba6b/config/boot.rb:123
/usr/src/peritor-webistrano-a98ba6b/Rakefile:4:in `require'
/usr/src/peritor-webistrano-a98ba6b/Rakefile:4
/usr/lib/ruby/1.8/rake.rb:2383:in `load'
/usr/lib/ruby/1.8/rake.rb:2383:in `raw_load_rakefile'
/usr/lib/ruby/1.8/rake.rb:2017:in `load_rakefile'
/usr/lib/ruby/1.8/rake.rb:2068:in `standard_exception_handling'
/usr/lib/ruby/1.8/rake.rb:2016:in `load_rakefile'
/usr/lib/ruby/1.8/rake.rb:2000:in `run'
/usr/lib/ruby/1.8/rake.rb:2068:in `standard_exception_handling'
/usr/lib/ruby/1.8/rake.rb:1998:in `run'
/usr/bin/rake:28
According to rake error message, apparently some gems aren't properly installed, which seems weird to be, but I guess he can't find it.
So I double check with bundle tool:
# bundle check
Your Gemfile's dependencies could not be satisfied
Install missing gems with `bundle install`
# bundle show
Could not find gem 'mocha (= 0.9.8, runtime)' in any of the gem sources listed in your Gemfile.
And I'm stuck here, I just don't know how to continue.
I google around about mocha or gemfile issue, but haven't found much relevant.
I hope everything is clear and easy to understand as this is my first post.
Thanks for any reply/hints, also if I manage to evolve I'll try keeping you up to date!
Check these instructions:
http://www.gogolek.co.uk/blog/2012/10/web-application-deployment-webistrano-capistrano/
Additionally I had problems with mysql gem installation on my clean debian 6 64-bit, so I had to run
$ apt-get install libmysqlclient-dev ruby-dev
I ended up with following gems installed
Using rake (0.8.7)
Using activesupport (2.3.11)
Using rack (1.1.6)
Using actionpack (2.3.11)
Using actionmailer (2.3.11)
Using activerecord (2.3.11)
Using activeresource (2.3.11)
Using bundler (1.0.10)
Using highline (1.6.20)
Using net-ssh (2.7.0)
Using net-scp (1.1.2)
Using net-sftp (2.1.2)
Using net-ssh-gateway (1.2.0)
Using capistrano (2.6.0)
Using erubis (2.7.0)
Using exception_notification (2.3.3.0)
Using mocha (0.9.8)
Installing mysql (2.9.1) with native extensions
Installing open4 (0.9.3)
Installing rails (2.3.11)
Installing syntax (1.0.0)
Your bundle is updated! Use `bundle show [gemname]` to see where a bundled gem is installed.

Resources