-2

I developed a web app with Ruby On Rails. In my local machine I used RVM to manage Ruby versions. I'm using ruby 2.7.1 and rails 6.

Now I'm trying to deploy this app to a Digital Ocean droplet using this guide: https://gorails.com/deploy/ubuntu/18.04. I'm using the same stack as the guide, so I'm using rbenv.

I finished all the settings and now I'm trying to run cap production deploy. But I'm getting this error: Bundler::GemNotFound: Could not find name_of_gem in any of the sources

This happens when capistrano is running rake db:migrate. I tried installing the gem manually but then it shows that same error for a different gem and this keeps happenning. It looks like capistrano is not executing bundle install.

Can someone help me please?

  • Please see "[ask]", "[Stack Overflow question checklist](https://meta.stackoverflow.com/questions/260648)" and all their linked pages. An explanation of what you've done doesn't help nearly as much as the smallest code that duplicates the problem. – the Tin Man May 26 '20 at 05:17

1 Answers1

0

I saw your steps on gorails. As you said:

In my local machine I used RVM to manage Ruby versions.

According to step Setting Up Capistrano, it demands you to include gem 'capistrano-rbenv' in your local machine. However, there is an advise in rbenv official repository:

Compatibility note: rbenv is incompatible with RVM. Please make sure to fully uninstall RVM and remove any references to it from your shell initialization files before installing rbenv.

Although it is not saying nothing about capistrano-rbenv, it will act like a version manager as well.

It said, you may uninstall your RMV or you may use a shell set to not find any reference for RMV path.

I saw many comments there about troubles with postgresql gem. If you only need to deploy your application to a online server, not metter what server it is, I recommend you to follow the famous learn enough rails tutorial: deploying on heroku.

An advise, you don't need to have postgresql inside your local machine to lauch it on the server, you may have sqlite default on it and postgresql on the server. Active Record know how to manage both with just one command