0

I've built a Rails App in RoR4 and need to deploy it on a server running version 3.2.13. When trying to run the rails server I get an error. How do I go about converting my app to run in an older version of rails?

This is what my gemfile looks like:

source 'https://rubygems.org'


gem 'rails', '4.0.2'
gem 'sqlite3'
#gem 'pg'
gem 'sass-rails' '~> 4.0.0'
gem 'uglifier', '>= 1.3.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jquery-turbolinks'
gem 'jbuilder', '~> 1.2'
gem 'acts-as-taggable-on'

group :doc do

  gem 'sdoc', require: false
end

group :development, :test do
end

This is the error I get when I try to run the rails server:

 dhcp-10-156-44-120:icon-library Lewis$ rails s
Usage:
  rails new APP_PATH [options]

Options:
  -r, [--ruby=PATH]              # Path to the Ruby binary of your choice
                                 # Default: /Users/yudi/.rvm/rubies/ruby-2.0.0-p353/bin/ruby
  -b, [--builder=BUILDER]        # Path to a application builder (can be a filesystem path or URL)
  -m, [--template=TEMPLATE]      # Path to an application template (can be a filesystem path or URL)
      [--skip-gemfile]           # Don't create a Gemfile
      [--skip-bundle]            # Don't run bundle install
  -G, [--skip-git]               # Skip Git ignores and keeps
  -O, [--skip-active-record]     # Skip Active Record files
  -S, [--skip-sprockets]         # Skip Sprockets files
  -d, [--database=DATABASE]      # Preconfigure for selected database (options: mysql/oracle/postgresql/sqlite3/frontbase/ibm_db/sqlserver/jdbcmysql/jdbcsqlite3/jdbcpostgresql/jdbc)
                                 # Default: sqlite3
  -j, [--javascript=JAVASCRIPT]  # Preconfigure for selected JavaScript library
                                 # Default: jquery
  -J, [--skip-javascript]        # Skip JavaScript files
      [--dev]                    # Setup the application with Gemfile pointing to your Rails checkout
      [--edge]                   # Setup the application with Gemfile pointing to Rails repository
  -T, [--skip-test-unit]         # Skip Test::Unit files
      [--old-style-hash]         # Force using old style hash (:foo => 'bar') on Ruby >= 1.9

Runtime options:
  -f, [--force]    # Overwrite files that already exist
  -p, [--pretend]  # Run but do not make any changes
  -q, [--quiet]    # Suppress status output
  -s, [--skip]     # Skip files that already exist

Rails options:
  -h, [--help]     # Show this help message and quit
  -v, [--version]  # Show Rails version number and quit

Description:
    The 'rails new' command creates a new Rails application with a default
    directory structure and configuration at the path you specify.

    You can specify extra command-line arguments to be used every time
    'rails new' runs in the .railsrc configuration file in your home directory.

    Note that the arguments specified in the .railsrc file don't affect the
    defaults values shown above in this help message.

Example:
    rails new ~/Code/Ruby/weblog

    This generates a skeletal Rails installation in ~/Code/Ruby/weblog.
    See the README in the newly created application to get going.
dhcp-10-156-44-120:icon-library Lewis$
tshepang
  • 12,111
  • 21
  • 91
  • 136
LLong
  • 167
  • 13

1 Answers1

0

Just a wild guess, but to me it seems that your problem might be that your server does not recognize your rails s command because you're running wrong versions of ruby and rails for your app.

First step would be to run in terminal:

ruby -v

Let's say that your ruby version is 1.9.3, then the output of the above command would be: ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-linux]

Add you ruby version to the top of your Gemfile:

ruby "1.9.3"

Add desired rails version to the Gemfile:

gem 'rails', '3.2.13'

After that run bundle install

You will probably have to make a lot more changes to your rails app as you go along, but this should make your server at least recognize your app.

Levara
  • 1,058
  • 2
  • 12
  • 21