Reputation: 15181
When I tried to deploy a rails project from windows local environment to linux(CentOS6.5) server, I got a error from capistrano 3.
Gem::LoadError: Specified 'postgresql' for database adapter, but the gem is not loaded. Add `gem 'pg'` to your Gemfile.
I had a gem 'pg'
in Gemfile
though. I found a line that cause the problem in Gemfile.lock
.
pg (0.17.1-x86-mingw32)
When I removed Gemfile.lock
and run bundle install
in another linux virtual host, the problem was solved. But I couldn't find out the way how to solve it in windows.
As far as I understand, I must send Gemfile.lock
to server if I use Capistrano
.
And Gemfile.lock
created in windows is incompatible with one created in linux or osx.
Is there no way to deploy from windows to linux server with postgres by using capistrano?
Upvotes: 6
Views: 633
Reputation: 20624
Looks like this has been an issue with bundler for many years: current open 'issue' on github: https://github.com/bundler/bundler-features/issues/4
original issue (4 years old) : https://github.com/bundler/bundler/issues/646
Looks like Heroku actually removes Gemfile.lock if it references Windows specific gems
From: https://devcenter.heroku.com/articles/bundler-windows-gemfile
Be as specific in your Gemfile as you possibly can when developing on Windows. If only one developer on your team has a Windows machine, consider not checking in their Gemfile.lock changes or manually bundle installing and committing on a non-Windows machine before deploying.
And https://ninefold.com/ has similar recommendation: hacking the Gemfile.lock
https://help.ninefold.com/hc/en-us/articles/201335424-Deploying-a-Windows-Created-Rails-App
Upvotes: 1
Reputation: 2129
there is no matter if you use windows/linux/mac to run capistrano scripts.
Please provide full system details(the remote machine).
did you installed ruby there using what (RVM/rbenv)?
do you have all the native extensions to build the gems on the machine?
http://alexpotrykus.com/blog/2013/04/05/rails-deployment-with-unicorn-and-nginx-on-centos-6-dot-3/
see the above link and try the config your system(this use Capistrano 2 but use your scripts just build the machine as written in the article)
Upvotes: 0