Coder Social home page Coder Social logo

dyruby's Introduction

OpenShift Ruby Cartridge

The ruby cartridge provides a bare metal Rack application with Ruby.

Template Repository Layout

tmp/               Temporary storage
public/            Content (images, css, etc. available to the public)
config.ru          This file is used by Rack-based servers to start the application.
.openshift/        Location for OpenShift specific files
  action_hooks/    See the Action Hooks documentation [1]
  markers/         See the Markers section [2]

[1] Action Hooks documentation [2] Markers

Notes about layout

Every time you push, everything in your remote repo dir gets recreated, please store long term items (like an sqlite database) in the OpenShift data directory, which will persist between pushes of your repo. The OpenShift data directory is accessible relative to the remote repo directory (../data) or via an environment variable OPENSHIFT_DATA_DIR.

Ruby Mirror

OpenShift is mirroring rubygems.org at http://mirror1.ops.rhcloud.com/mirror/ruby/ This mirror is on the same network as your application, and your gem download should be faster.

To use the OpenShift mirror:

Edit your Gemfile and replace source 'http://rubygems.org'

with source 'http://mirror1.ops.rhcloud.com/mirror/ruby/'

Edit your Gemfile.lock and replace remote: http://rubygems.org/

with remote: http://mirror1.ops.rhcloud.com/mirror/ruby/

Rails 3.0

Option 1) (Recommended) Git push your application Gemfile/Gemfile.lock. This will cause the remote OpenShift node to run bundle install --deployment to download and install your dependencies. Each subsequent git push will use the previously downloaded dependencies as a starting point, so additional downloads will be a delta.

Option 2) Git add your .bundle and vendor/bundle directories after running bundle install --deployment locally. Be sure to exclude any gems that have native code or ensure they can run on RHEL x86_64.

Environment Variables

The ruby cartridge provides several environment variables to reference for ease of use:

OPENSHIFT_RUBY_LOGDIR          Log files go here.
OPENSHIFT_RUBY_VERSION         The Ruby language version. The valid values are `1.8` and `1.9`.

For more information about environment variables, consult the OpenShift Application Author Guide.

threaddump command

OpenShift's CLI tool, rhc, has a subcommand threaddump. Applications created by this cartridge respond to this command by looking for the appropriate Rack process, and sending ABRT signal to it. As explained in Passenger User Guide, this signal will dump the current thread backtraces but also terminates the processes.

Note that Rack process may not exist if the application had just started and not been accessed.

Note also that scaled applications are not supported by the threaddump command.

dyruby's People

Contributors

duyanyan avatar

Watchers

James Cloos avatar  avatar

Forkers

qwang1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.