Error About Nokogiri While Capistrano Deployment on Ubuntu Server

Error about nokogiri while capistrano deployment on ubuntu server

I faced the same issue with Nokogiri 1.6.0. The problem, as you can see from the logs, it's caused by a failed compilation of libxml2 that, together with libxslt, is now shipped embedded in the gem and compiled when you install it.

To find out what exactly went wrong with the compilation, have a look at the suggested file compile.log that, in your case, you can find at:

/home/deployer/.rvm/gems/ruby-2.0.0-p0/gems/nokogiri-1.6.0/ext/nokogiri/tmp/x86_64-linux-gnu/ports/libxml2/2.8.0/compile.log

As a workaround (assuming you have libxml2-dev and libxslt-dev installed), you can do:

NOKOGIRI_USE_SYSTEM_LIBRARIES=1 bundle install

I hope it helps.

capistrano deploy can't install nokogiri

I was missing one of the ruby dev dependencies for ubuntu: http://nokogiri.org/tutorials/installing_nokogiri.html

Also, for some reason this server only gave root permissions to access some of the nokogiri dependencies, I had to chmod them for my deploy user.

Failed to deploy app via Capistrano, LoadError: cannot load such file -- nokogiri

I have found solution and I think it is not good.

In my Gemfile.lock I have deleted all -64x-mingw strings, leaving only name and verison number of my gems.

In platform I simply wrote ruby instead of mingw.

Well... that worked.

Heroku deletes Windows Gemfile.lock and generates new one automatically. Is it possible to send to capistrano that kind of commands?

Bundler Error when attempting Capistrano Deployment

I was able to get past this blocker. The ultimate issue is that I had to log into the correct shell and run gem install bundler:1.16.1.

In order to log into the bash I used this command:
/bin/bash --login

Then run gem install:
gem install bundler:1.16.1

Corrupt Gemfile.lock Error with Capistrano

Looks like you are developing on a Windows machine. My guess is that you are trying to deploy to Linux. I'm sorry to say, that's not going to work.

You'll notice that your Gemfile.lock has references to the x86-mingw32 version of Nokogiri, which can't be used on the server.

There is no easy solution to this, unfortunately. Heroku solves this problem by completely deleting the Gemfile.lock during deployment, which forces Bundler to re-resolve all dependencies. This works, but now your dependencies are no longer locked and are unpredictable. Heroku will say:

Removing Gemfile.lock because it was generated on Windows.
Bundler will do a full resolve so native gems are handled properly.
This may result in unexpected gem versions being used in your app.
In rare occasions Bundler may not be able to resolve your dependencies at all.
https://devcenter.heroku.com/articles/bundler-windows-gemfile

You could do something similar in Capistrano with some custom code that deletes Gemfile.lock before the Bundler task runs (or just remove Gemfile.lock from source control entirely). You'd also have to change the Bundler arguments to remove the --deployment flag, otherwise it will fail when it sees the Gemfile.lock is missing.

Or you could switch your development environment to Mac or Linux, e.g. by using a Linux VM for development.

Rails deploy on Ubuntu with capistrano error: Could not create Makefile due to some reason, probably lack of necessary

In production environment, you don't need to debug the application. debugger is dependency of pry-rails. So, you should specify that rails should install pry-rails gem only in development and test environment.

In your Gemfile replace

gem 'pry-rails'
gem 'pry-plus'

with

group :development do
gem 'pry-rails'
gem 'pry-plus'
end

Then run bundle install and push your latest changes to your repo.

Now deploy code again:

cap production deploy


Related Topics



Leave a reply



Submit