Could not find gem 'mocha (= 0.12.3) x86-mingw32' - ruby-on-rails-3

I try to launch redmine from IDE:
rails/redmine/script/rails server -b 127.0.0.1 -p 3000 -e development
but I am getting error:
/resolver.rb:287:in `resolve': Could not find gem 'mocha (= 0.12.3) x86-mingw32' in the gems available on this machine. (Bundler::GemNotFound)
I installed mocha:
gem install mocha
But error still appear.

Try installing it with the same exact version:
gem install mocha -v '0.12.3'

Related

Could not find 'ffi' (>= 1.3.0) among 85 total gem(s) (Gem::MissingSpecError) React native IOS on pod install

Hi I'm trying to run my react native app on mac mini. I can run another app also this app to but when i write pod install in terminal it gives this error.
1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification.rb:1449:in `block in activate_dependencies'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/dependency.rb:311:in `to_specs': Could not find 'ffi' (>= 1.3.0) among 85 total gem(s) (Gem::MissingSpecError)
Checked in
'GEM_PATH=/Users/xx/.gem/ruby/2.6.0:/Library/Ruby/Gems/2.6.0:/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/gems/2.6.0', execute `gem env` for more information
I tryed a lot like this code
sudo gem pristine --all, gem pristine --all
sudo gem install -n /usr/local/bin cocoapods -v 1.8.4
delete and ini pod init/ which gave error
brew reinstall cocoapods
\curl -sSL https://get.rvm.io | bash -s stable --ruby
You can try this command
sudo gem uninstall -aIx
rm -rf ~/.gem
sudo gem install cocoapods
sudo chown -R $USER ~/Library/Caches/CocoaPods
For me, install a new version of ruby resolved this issue.
curl -L https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
rvm list known
rvm install 2.7.2
sudo gem install cocoapods
Same issue. Just updating gem package manager is works for me
gem update
Terminal will display installing 'ffi'
Successfully installed ffi-1.15.5
i solved the issue by installing the command line tool for XCode.
Just download the specific CLT from apple website
I just did a
bundle install
and that allowed me to do a pod install after upgrading (without asking me to Xcode 14).

cocoa pods error failed to build gem native extension on Mac

ERROR: Error installing cocoapods:
ERROR: Failed to build gem native extension.
current directory: /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.18/ext/ffi_c
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -r ./siteconf20200728-45926-1h0nq8i.rb extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/includ.e/ruby.h
extconf failed, exit code 1
Gem files will remain installed in /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.18 for inspection.
Results logged to /Library/Ruby/Gems/2.3.0/extensions/universal-darwin-18/2.3.0/ffi-1.9.18/gem_make.out
I'm just trying to install it and it doesn't work.
PS: I also already have cocoa pods. I am simply following the instructions on react native setting up your environment
The below steps would fix that issue:
Ensure ruby is installed and up to date: ruby -v
Update gem's sudo gem update --system
xcode-select --install
sudo gem install -n /usr/local/bin cocoapods
Solved it by updating the repo
sudo gem repo update

Unable to install cocoapods in my Mac 10.13.1

i am using following command:
sudo gem install cocoapods
for this i am getting following response:
ERROR: Could not find a valid gem 'cocoapods' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - Errno::ECONNREFUSED: Failed to open TCP connection to api.rubygems.org:443 (Connection refused - connect(2) for "api.rubygems.org" port 443) (https://api.rubygems.org/specs.4.8.gz)
i tried uninstalling cocoapods and restart ....everything.
upadte 1:
i try to debug
gem install bundler --debug -V
i got following output:
Exception `LoadError' at /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/resolv.rb:171 - LoadError
Exception `Gem::UnsatisfiableDependencyError' at /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/resolver/installer_set.rb:71 - Unable to resolve dependency: user requested 'bundler (>= 0)'
ERROR: Could not find a valid gem 'bundler' (>= 0) in any repository
Update 2:
i changed proxys in my mac .. now i am getting :
Could not find a valid gem 'cocoapods' (>= 0) in any repository
finally i found the answer:
just connected to ur personal Hotspot and use following command:
$ sudo gem install cocoapods --source http://rubygems.org
It appeared that it was my VPN that was not allowing the download, so the incoming readers should take care of that as well.
I tried to deactivate it after I read #Cristik answer by the way.

I am getting this error while installing blacklight project in ruby on rails for the bundle install in ubuntu 16.04

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /tmp/bundler20170529-7305-1ybn2iijson-1.8.6/gems/json-1.8.6/ext/json/ext/generator
/usr/bin/ruby2.3 -r ./siteconf20170529-7305-1qu2mp6.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h
extconf failed, exit code 1
Gem files will remain installed in /tmp/bundler20170529-7305-1ybn2iijson-1.8.6/gems/json-1.8.6 for inspection.
Results logged to /tmp/bundler20170529-7305-1ybn2iijson-1.8.6/extensions/x86_64-linux/2.3.0/json-1.8.6/gem_make.out
Thanks for asking! Do you have the ruby-dev package installed? You can get it with:
sudo apt-get install ruby-dev

Error deploying with cap deploy when using gem paperclip

I am using the gem Paperclip and now I wanted to deploy my app to the server using capistrano, but when run cap deploy I get the following message at the end:
* executing "cd /home/administrator/myApp/releases/20120506165329 && bundle install --gemfile /home/administrat
or/myApp/releases/20120506165329/Gemfile --path /home/administrator/myApp/shared/bundle --deployment --qui
et --without development test"
servers: ["myserver.com"]
[myserver.com] executing command
** [out :: myserver.com] Gem::InstallError: paperclip requires Ruby version >= 1.9.2.
** [out :: myserver.com] An error occured while installing paperclip (3.0.3), and Bundler cannot continue.
** [out :: myserver.com] Make sure that `gem install paperclip -v '3.0.3'` succeeds before bundling.
command finished in 66362ms
*** [deploy:update_code] rolling back
* executing "rm -rf /home/administrator/myApp/releases/20120506165329; true"
servers: ["myserver.com"]
[myserver.com] executing command
command finished in 66ms
failed: "sh -c 'cd /home/administrator/myApp/releases/20120506165329 && bundle install --gemfile /home/administra
tor/myApp/releases/20120506165329/Gemfile --path /home/administrator/myApp/shared/bundle --deployment --qu
iet --without development test'" on myserver.com
I have checked the version of Ruby in my server and I got:
$ruby -v
ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux]
I have also intalled the gem manually in the server by running
gem install paperclip -v '3.0.3'
...
Successfully installed paperclip-3.0.3
and ran cap deploy again, but the same message showed up
how can I deploy my app?
thanks you in advance
It was fixed by setting de default environments of capistrano as suggested in the accepted answer here
I can now deploy with capistrano (although my system ruby is still using ruby 1.8.7 so the gem paperclip does not get installed properly, you can find this problem here)