Heroku push hanging on "fetching gem metadata from rubygems" with no errors or trace of any kind - deployment

My deployment is stuck on fetching gem metadata from rubygems every time I deploy.
It worked this morning, had problems this afternoon and now it's not working again.
We tried from somewhere else and from other computers with the same result.
It works fine locally I can update from rubygems without a problem.
Visual:
Delta compression using up to 4 threads.
Compressing objects: 100% (9/9), done.
Writing objects: 100% (9/9), 764 bytes, done.
Total 9 (delta 7), reused 0 (delta 0)
-----> Heroku receiving push
-----> Ruby/Rails app detected
-----> Using Ruby version: ruby-1.9.3
-----> Installing dependencies using Bundler version 1.2.1
Running: bundle install --without development:test --path vendor/bundle --binstubs bin/
Updating https://github.com/epetre/negative-captcha.git
Fetching gem metadata from http://rubygems.org/.......
Fetching gem metadata from http://rubygems.org/..
[IT HANGS HERE FOREVER]
Anyone has a clue?

Fixed by adding bundler to the gem file and forcing a version
gem 'bundler', '1.2.1'

Ok, fixed for good I think.
Turns out it only works when explicitly specifying the last versions of heroku and bundler.
The strange thing is that it can bundle without the explicit versions locally but not when deploying to heroku.
gem 'heroku', '2.33.0'
gem 'bundler', '1.2.1'

For me changing the protocol to fetch gem fixed the problem.
I changed https://github.com/epetre/negative-captcha.git to git://github.com/epetre/negative-captcha.git in gem file. Bundled it and pushed to heroku and it works.

Related

Fastlane "nokogiri requires Ruby version >= 2.3.0." Error

I finished this tutorial on Medium in order to integrate my Xcode project with SonarQube to have some metrics. Setup SonarQube - Swift. I was able to make it through the last step that is: running fastlane metrics on the terminal while being in the root of the project directory. But I get this error on step "slather".
nokogiri requires Ruby version >= 2.3.0., fastlane finished with errors:
I have also found that someone had a similar question here, but no answers:
Similar Question
If I run:
nicolas$ ruby --version
I get ruby version 2.6.3, which is higher than the required 2.3
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]
Does anyone knows how to fix this, or got any hunches? Thanks in advance, I appreciate any help.
After digging around and trying several solutions, I finally solved this. What happened was that I initially installed Fastlane with this command:
brew cask install Fastlane
And it seems that it was using another version of ruby while I had a newer one. So I uninstalled it with:
brew cask uninstall Fastlane
And then I re-installed it with this command:
sudo gem install -n /usr/local/bin fastlane -NV
Because I was having problems with permissions and then all worked good.
References and other solutions:
Github thread
usr/local/bin

Whenever gem in rails error :'to_specs': Could not find bundler (>= 0) amongst

I am using whenever gem in my application. And i have scheduled a rake task every 5 minutes. But that rake task is not running every 5 minutes. When i saw the log it gave me error like
`to_specs': Could not find bundler (>= 0) amongst [bigdecimal-1.1.0,
io-console-0.3, json-1.5.4, minitest-2.5.1, rake-0.9.2.2, rdoc-3.9.4]
(Gem::LoadError)
this is the content in schedule.rb
every 3.minutes do
rake "mytask name"
end
I had same issue solved by putting
env :PATH, '/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin'
instead of
env :PATH, ENV['PATH']
on the top of config/schedule.rb
This issue occurs whenever we changes in your gem file, specially rails / ruby version.
I was facing this same issue, here is what I did to get rid of that-
1. $ gem install bundle
2. $ bundle install
Now everything working fine.
If you are getting same issue as-
`to_specs': Could not find 'railties' (>= 0) among 23 total gem(s) (Gem::LoadError)
then here are the steps-
See the link as-
Rails: Could not find railties
1. $ gem list
2. $ gem install rails
It will just download all missing dependencies, including railties.
Hope this will work for you too !!!

Trouble upgrading to rails 2.3.15 with rack 1.1.3

I'm getting the following error when trying to fire up script/console for my rails 2.3.15 app, after upgrading from rails 2.3.5. Does this mean the issue is with bundler 1.2.1 is not compatible with rack 1.1.3? Any help would be appreciated immensely.
usr/lib/ruby/gems/1.8/gems/bundler-1.2.1/lib/bundler/rubygems_integration.rb:157:in gem': can't activate rack (~> 1.0.1), already activated rack-1.1.3. Make sure all dependencies are added to Gemfile. (Gem::LoadError)
from /home/developer/bigpink/vendor/rails/actionpack/lib/action_controller.rb:34
from /home/developer/bigpink/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:inrequire'
from /home/developer/bigpink/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in require'
from /home/developer/bigpink/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:innew_constants_in'
from /home/developer/bigpink/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in require'
from /home/developer/bigpink/vendor/rails/railties/lib/commands/server.rb:2
from script/server:3:inrequire'
from script/server:3
In my case, problem solved by the following steps:
Deleted the directory $PROJECT_ROOT/vendor/rails
Modified RAILS_GEM_VERSION in config/environment.rb
we used this process to upgrade Rails to 3.2.11 on our Heroku apps (as reported here)
stop – your Ruby on Rails (RoR) server
edit – appropriate line in gem file to read [one of]:
gem ‘rails’, ’3.2.11′
gem ‘rails’, ’3.1.10′
gem ‘rails’, ’3.0.19′
gem ‘rails’, ’2.3.15′
run – gem update
run – bundle update
run - bundle install
test – rspec # or test-driven dev’t framework of choice
launch – rails s
test – # interact with Rails server & explore if all is well
run – git add .
run – git commit -a -m “upgrade Rails server to ver. [x.y.z]“
run - git push # to github or rcs of choice
run - git push heroku # or to deployment server of choice

Rails 3.1 - Pushing to Heroku - Errors installing postgres adapter?

I just upgraded to Rails 3.1 and the first app i've tried to deploy to Heroku has encountered a problem relating to Postgres adapter. I'm able to push the app to heroku but then when i try to migrate the database i get the following error:
heroku rake db:migrate
rake aborted!
Please install the postgresql adapter: `gem install activerecord-postgresql-adapter`
(pg is not part of the bundle. Add it to Gemfile.)
Tasks: TOP => db:migrate => db:load_config
(See full trace by running task with --trace)
when I try their suggested install i get:
ERROR: Could not find a valid gem 'activerecord-postgresql-adapter' (>= 0) in any repository
ERROR: Possible alternatives: activerecord-postgis-adapter, activerecord-jdbcpostgresql-adapter, activerecord-postgresql-cursors, activerecord-jdbcmysql-adapter, activerecord-jdbcmssql-adapter
which already seems weird... so what exact gem should I install to get this thing working if not what they say I should install??
When I try installing gem pg i get:
Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
/Users/jerometufte/.rvm/rubies/ruby-1.9.2-p180/bin/ruby extconf.rb
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again with
--with-pg-config=/path/to/pg_config
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
...
I'm using SQLite3 currently. Any help greatly appreciated, this is baffling me.
Option 1:
Add pg to your Gemfile but skip trying to install it locally.
$ cat Gemfile
...
group :production do
# gems specifically for Heroku go here
gem "pg"
end
# Skip attempting to install the pg gem
$ bundle install --without production
Option 2 (Debian/Ubuntu):
Add pg to your Gemfile but first install the prerequisites.
$ cat Gemfile
...
group :production do
# gems specifically for Heroku go here
gem "pg"
end
# Install the pg gem's dependencies first
$ sudo apt-get install libpq-dev
# Then install the pg gem along with all the other gems
$ bundle install
You definitely need pg in the Gemfile for Heroku.
About the error you're getting locally: make sure you have postgres installed, run gem install pq -- --with-pg-config=[path to wherever your pg-config binary is], then bundle install.
Alternatively, if your local database is working fine (either because you're using sqlite or postgres-pr), you could put the gem 'pg' line in your Gemfile in a group called production, then bundle install --without production locally.
More up-to-date info: It had something to do with a different version of pg gem locally.
I already had pg in a production group (I run sqllite locally), but Heroku was still puking.
The problem went away for my new Rails 3.1 app when I:
rm Gemfile.lock
touch Gemfile
bundle install
git add .
git commit -am "wiped Gemfile.lock re-ran bundle install"
git push heroku master
worked like a charm when I then ran heroku run rake db:migrate

Why does Heroku always find unresolved dependencies?

I haven't installed any gems since the last time I deployed, but
Heroku keeps thinking there is something new I suppose, and that
significantly slows down my deployment time. How can I make sure that
I don't get this message?
EDIT:
This is from my deployment message. I dunno...is it normal?
Writing objects: 100% (13/13), 1.88 KiB, done.
Total 13 (delta 10), reused 0 (delta 0)
-----> Heroku receiving push
-----> Rails app detected
-----> Detected Rails is not set to serve static_assets
Installing rails3_serve_static_assets... done
-----> Gemfile detected, running Bundler version 1.0.7
Unresolved dependencies detected; Installing...
Using --without test:development:staging
Fetching source index for http://rubygems.org/
$ git add Gemfile.lock
$ git commit -m "We should always check in Gemfile.lock in our applications."
$ git push heroku master
I contacted support and they resolved it.