How to fix Passenger "Unexpected end-of-file detected" error

This is for you if Passenger gives you the following useless error message.

Passenger encountered the following error:\
The application spawner server exited unexpectedly: Unexpected end-of-file detected.

Exception class:
PhusionPassenger::Rack::ApplicationSpawner::Error

Most often this happens because you are missing a gem. Usually Passenger would tell you about that but in some cases it can't.

To resolve this issue, run:

bundle install

If this does not do the trick for you, take a look at the Apache log files for de...

whenever: Preview the crontab

If you'd like to preview the crontab that whenever will deploy, run the following:

bundle exec whenever

This will print the cron syntax without modifying your local crontab.

Fix "libmysqlclient.so.20: cannot open shared object file: No such file or directory"

This error can be caused by the mysql2 gem under mysterious circumstances. You need to remove it with gem uninstall mysql2 and then reinstall it (or just run bundle).

gem pristine mysql2 will not be enough.

Katapult 0.5.0 released

New Features

  • Deployment ready for Opscomplete
  • Copying view and controller templates over to target application during
    basics configuration or via new command katapult templates.
  • "Usage" section in README rewritten: Now describes two usage scenarios.

Improvements

  • Generating a fixed Gemfile.lock. Run bundle update after code generation to
    update all gems to recent versions.
  • Better deployment with Webpack
  • Navigation only rendered if requested
  • Some minor fixes

Using Bumbler to Reduce Runtime Dependencies - The Lean Software Boutique

Tool to show you which gems are slow to load:

➜  git:(master) ✗ bundle exec bumbler
[#################################################                             ]
(49/65) travis-lint...
Slow requires:
    110.21  render_anywhere
    147.33  nokogiri
    173.83  haml
    179.62  sass-rails
    205.04  delayed_job_active_record
    286.76  rails
    289.36  mail
    291.98  capistrano
    326.05  delayed_job
    414.27  pry
    852.13  salesforce_bulk_api

Git: Issues with Gemfile.lock

When there's a Gemfile.lock in your working directory that you cannot remove by either checkout, reset [--hard], stash, probably Rails' Spring is the culprit and not Bundler itself.

Fix

spring stop

The author of the linked Stackoverflow post supposes Spring re-writes the Gemfile.lock on change to ensure all Spring processes are using the same gem versions. Meh.

Traveling Ruby: self-contained, portable Ruby binaries

Traveling Ruby is a project which supplies self-contained, "portable" Ruby binaries: Ruby binaries that can run on any Linux distribution and any OS X machine. This allows Ruby app developers to bundle these binaries with their Ruby app, so that they can distribute a single package to end users, without needing end users to first install Ruby or gems.

Angular-xeditable :: Edit in place for AngularJS

Angular-xeditable is a bundle of AngularJS directives that allows you to create editable elements.

Such technique is also known as click-to-edit or edit-in-place.

It is based on ideas of x-editable but was written from scratch to use power of angular and support complex forms / editable grids.

Introducing Isolate

The basics of Isolate, a tool for replacing Bundler in gem management.

A nicer way to run RSpec and/or Cucumber

geordi, our collection of awesome shell scripts, has been extended by three scripts to help you call RSpec or Cucumber:

cuc

This script runs Cucumber the way you want it:

  • Prints some line feeds to easily find your test results when you come back to the console later
  • Configures Cucumber to use cucumber_spinner if it is available in your Gemfile
  • Runs Cucumber under bundle exec
  • Uses an old version of Firefox for Selenium (Javascript) features...

Using rbenv on Ubuntu 18.04+

We will be installing rbenv and ruby-build from our own fork, not from the Ubuntu sources.

Installing rbenv

  1. Install rbenv:

    git clone https://github.com/rbenv/rbenv.git ~/.rbenv
    

    For Bash:

    echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
    echo 'eval "$(rbenv init -)"' >> ~/.bashrc
    

    For ZSH:

    echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshrc
    echo 'eval "$(rbenv init -)"' >> ~/.zshrc
    

    Now reinitialize ...

Release gem; Deploy gem; Update a gem created with Jeweler

Until May 2011 our gems have been created with Jeweler, which is a helper library to package code into a gem. You know a gem was cut with Jeweler if you see the word jeweler in a gem project's Rakefile.

This note describes how to update a gem that was cut using Jeweler. Note that this can be traumatic the first time. It would be great to have an easier workflow for this. Jeweler is deprecated these days because you can

**now [cut gems more easily using Bundler](https://makandracards.com/makandra/1229-updat...

Live CSS / view reloading

Next time you have to do more than trivial CSS changes on a project, you probably want to have live CSS reloading, so every time you safe your css, the browser updates automatically. It's pretty easy to set up and will safe you a lot of time in the long run. It will also instantly reload changes to your html views.

Simply follow the instructions below, taken from blog.55minutes.com.

Install CSS live reload (only once per project)

  1. Add th...

How to: Fix incorrect MySQL client library version

Bundler::GemRequireError: There was an error while trying to load the gem 'mysql2'.
Gem Load Error is: Incorrect MySQL client library version! This gem was compiled for 5.5.46 but the client library is 5.6.30.

Same as in Fix "libmysqlclient.so.20: cannot open shared object file: No such file or directory":

gem pristine mysql2

gem pristine re-installs a gem (without re-downloading), re-compiling all native extensions in the process.