Capistrano deployment broken by new request for Capistrano-Harrow gem? - ruby-on-rails

I thought my capistrano version was locked to 3.4.0, however it seems that it updated to 3.5. I tried going back to 3.4, but I keep getting the following message when I try to deploy my project to server.
DEBUG [72bb6fc3] An error occurred while installing capistrano-harrow (0.3.2), and Bundler cannot
continue.
Make sure that `gem install capistrano-harrow -v '0.3.2'` succeeds before
bundling.
I'm not familiar with capistrano-harrow, but read a little and doesn't seem like something I need. I did add to my gemfile in hopes of getting the deployment to send but even though that seemed to install fine, it still errors out for deployment. When I try executing gem install capistrano-harrow -v '0.3.2' - I get the following message and it doesn't install.
ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
bad response Not Found 404 (https://rubygems.global.ssl.fastly.net/quick/Marshal.4.8/capistrano-harrow-0.3.2.gemspec.rz)
Anyone know how I can either, opt out of harrow to try and get my deploy to work, or correct this issue to move forward? Thanks!
Update
I ran the following command to "opt-out", however, it still needs to build/install the gem I suppose which is currently the real issue.
git config harrow.disabled true

capistrano-harrow's 0.3.2 version seems to be yanked from Rubygems. There's a hint in the ERROR message you've pasted: Not Found 404 was received from the CDN.
If you're back on 3.4, the gem is not supposed to be in use but if you're running 3.5, please try to bundle update capistrano.

Related

Bundler 2, Gemfile not found error when running any rails or rake command

I am setting a new app, stack is:
ruby: 2.6.1 (using rvm)
rails: 5.2.2
bundler: 2.0.1
Now thing is, bundler 2 doesn't use Gemfile at all, i have proper gems.rb and gems.locked and everything was working properly until i pulled some code from a co-worker which got merged.
Issue is whenever i run any rake or rails command i get this error:
/path/to/proj/Gemfile not found
I then even tried going back to old master when that code was not merged and issue is still there. So it is probably not something in the code i pulled.
And issue seems persistent in different machines.
I know there are other issues which have similar errors of Gemfile not found but those are mostly those which had wrong directory opened or some gem issued fixed by bundle update or gem update type commands, this is not that issue because. This is something else, because bundler 2 doesn't even need Gemfile.
It looks like rails doesn't support using gems.rb and gems.locked. https://github.com/rails/rails/issues/31295
You could try what that guy did and edit some files, or you could rename your gems.rb back to Gemfile and gems.locked back to Gemfile.lock

Rails App - with pg database - errors with setup

I am in rails setup hell.
I tried to make an app 2 years ago and after endless problems with it, I tried to make a fresh app and start again. I"m now having the same problem I had the first time around in getting the pg database setup, but none of the solutions offered for the first problem are working this time. My post about the problem the first time is here: Installing PG gem on OS X - failure to build native extension
Currently - I'm getting this error:
An error occurred while installing pg (0.18.4), and Bundler cannot continue.
Make sure that gem install pg -v '0.18.4' succeeds before bundling.
I have tried uninstalling and reinstalling pg. I have tried installing with home-brew. I have tried all of the suggestions in the previous post I wrote about this problem with my first app. I've tried the solutions in this post:
Ruby/PgSQL error on Rails start : cannot load such file -- pg_ext (LoadError)
Each time, the gem installs correctly. It's just I can't start the server or do anything from the command line - this error keeps coming up.
One of the steps I tried involved adding this to my command line. It's a straight copy & paste. I don't know what it means. I'm wondering if its a source of my issue:
export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/9.4/bin
When I try:
rake rails:update:bin
I get this error:
rake aborted!
LoadError: cannot load such file -- nokogiri/nokogiri
Does anyone know how to solve this problem? I'm in rails hell!
A similar issue is occur by a user. Please have look to this link. Hope this may helpful!!
Error message: Make sure that `gem install pg -v '0.18.1'` succeeds before bundling

gem install bouncy-castle-java for full support

I am getting this warning message on the deployment server, when I start the server or running the console.
OpenSSL ASN1/PKey/X509/Netscape/PKCS7 implementation unavailable
gem install bouncy-castle-java for full support.
Also, When I try to generate the Key with following command.
OpenSSL::PKey::RSA.new(PUBLIC_KEY)
I get following exception
OpenSSL::PKey::RSAError: Neither PUB key nor PRIV key:
from org/jruby/ext/openssl/PKeyRSA.java:278:in `initialize'
I am bit confused with the message. I have the bouncy-castle-java installed on the machine. But I am still confused with message.
I am not sure abt the issue. Can anyone explain the issue, Or give me some directions.
I have fixed this issue on my end by installing jruby openssl 0.8.8 on the server.
As far as I remember there was an conflict with jruby and openssl gem that was used in the gem list(So I had to update the Gem)

Why does heroku app crash saying "No such file to load -- nokogiri (LoadError)"?

I just tried deploying my app to Heroku. It's been working for quite a while, I am just adding some new features. Once I deployed, I got an "App Crashed" error. heroku logs showed No such file to load -- nokogiri (LoadError).
Now, on my system, my Gemfile.lock showed 2 different nokogiri gems: nokogiri (~> 1.5.0), a dependency of fog (1.4.0) and nokogiri (1.5.5-x86-mingw32) which doesn't appear to be a dependency of anything. Under platforms was only x86-mingw32. My development computer is Windows 7 with ruby 1.9.3p194 and the Ruby version that the Heroku toolbalt uses for itself is heroku-toolbelt/2.30.1 (i386-mingw32) ruby/1.9.2.
My version of Bundler was up to date, my version of the Heroku toolbelt was up to date. I tried deleting Gemfile.lock and re-deploying on the advice of some forum posts, but the app was still crashed.
It appears that Heroku was simply not bundling in the right version of nokogiri, but was ignoring it on account of my use of Windows. The way I got to to be fixed was I added gem 'nokogiri', '~> 1.5.5' to my gemfile (even though my app does not explicitly need nokogiri, it is only a dependency) and then re-deployed to Heroku without running bundle install on my own system first. Now the app does not crash.
I have no idea why this worked. I don't know how to ensure the problem doesn't occur again, I just happened to get lucky with a desperate patch. I can't have this downtime in the future, or worry about something like this happening again for a routine deploy. Can someone please explain what was actually wrong and the right way to solve it?
Add this
PLATFORMS
x86-mingw32
to your Gemfile. Heroku will then ignore your Gemfile.lock because windows has crazy different dependencies.

Ruby on Rails, bundle deployment dreamhost

I ran into some problem with passenger on Dreamhost after installing refinerycms with its blog plugin. The rack just failed without any information about the
problem, It only said "... please check the server log ... " and a stack trace
without any message about the error.
After a while trying to reinstall but failed, running in the same problem. I finally have it work by doing 2 steps:
1) bundle install --deployment
==> It now shows the error about the differences in Rack version, my required 1.2.4 but it's 1.2.1 configured.
( I did 'bundle install' before but not solve the problem of rack )
2) I googled and update my Gemfile.lock to 1.2.4
AND IT WORKS ... LIKE MAGIC...
Can someone explain to me :
what did "bundle install --deployment" do differently from
"bundle install" ?
What's "Gemfile" and "Gemfile.lock" different ?
Any idea why It would work if I do like above ?
Thanks a lot
Rails 3's "bundle install" and "bundle install --deployment" both work well except the 2nd one just uses more disk space?
Gemfile keeps track of what gems are necessary and Gemfile.lock also keeps track of all your gems' dependencies
Regarding #3, Dreamhost basically requires rack 1.2.1, which you would normally set by having a line like this in your Gemfile:
gem "rack", "=1.2.1"
I assume that hacking the version into Gemfile.lock works because it is installed on the system already, so your app is able to load it without any problems. But it would certainly be better to just specify it in your Gemfile.
Getting rack-based apps running on Dreamhost can be a bit of a trial. If you continue to have problems, you will probably need to post some more details about your config and any specific errors you're getting.

Resources