1

I am trying to work with ryan bates' sample code that he uses for his railscast on Daemon (episode 129). I have rails 3 installed, and when I downloaded his code, I cannot run the server. To try and fix this, I copied my gemfile and gemfile.lock from a standard rails 3 application, and put it into his application, then ran bundle install. Still, my rails server does not respond. Instead, I get the following (see below).

My guess is that I am having issues because railscasts uses rails 2 (I believe) whereas I am using rails 3. Is there any way that I can still use his program?

Thanks.

Usage:

rails new APP_PATH [options]

Options:

-r, [--ruby=PATH]           # Path to the Ruby binary of your choice
                              # Default: /home/kyala/.rvm/rubies/ruby-1.9.2-p290/bin/ruby
-d, [--database=DATABASE]   # Preconfigure for selected database (options: mysql/oracle/postgresql/sqlite3/frontbase/ibm_db)enter code here
                              # Default: sqlite3
 -b, [--builder=BUILDER]     # Path to an application builder (can be a filesystem path or URL)
-m, [--template=TEMPLATE]   # Path to an application template (can be a filesystem path or URL)
      [--dev]                 # Setup the application with Gemfile pointing to your Rails 
checkout
      [--edge]                # Setup the application with Gemfile pointing to Rails 
repository
[--skip-gemfile]        # Don't create a Gemfile
 -O, [--skip-active-record]  # Skip Active Record files
 -T, [--skip-test-unit]      # Skip Test::Unit files
 -J, [--skip-prototype]      # Skip Prototype files
 -G, [--skip-git]            # Skip Git ignores and keeps

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

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

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

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.

favo
  • 5,426
  • 9
  • 42
  • 61
user924088
  • 107
  • 1
  • 10

2 Answers2

0

To run server in rails 3 you should use following command from your source folder:

rails server

But I think it's easier to install rails 2 and appropriate version of ruby than trying to fight issues of migrating from rails 2 to rails 3. To switch between different ruby version you may use rvm.

msergey
  • 592
  • 1
  • 4
  • 12
0

this is not going to work this way. there are too many differences between rails 3.x and 2.x (different behavior of rails command, different config, bundler etc).

i would create a new rails project and just copy the app folder from the screencast.

anyways, this is not a good idea, as the gems that are used for rails 2.x are different from those in rails 3.x so you will most likely experience some errors with this approach.

phoet
  • 18,688
  • 4
  • 46
  • 74