(Unable to start rails application) ruby scipt/server error

  1. I installed the ruby-1.9.2-p0 and rubygems-1.3.7 in the (/usr/local/src directory )

  2. Then i installed rails from terminal by typing follwoing

sudo gem install rails --include-dependencies

  1. Then i made a rails applcation from terminal as

rails new demo then cd demo ruby script/server

Here i got the error

internal:lib/rubygems/custom_require:29:in require': no such file to load -- script/../config/boot (LoadError) from <internal:lib/rubygems/custom_require>:29:in require’ from script/server:2:in `’

4)The details of script/serve file are as under

#!/usr/bin/env ruby require File.dirname(FILE) + ‘/…/config/boot’ require ‘commands/server’

Any suggesstion ??

thanks in advance

So you have rails3.0 installed? Then you need to use “rails server” or “rails s” to start your application.

Actually 'gem install rails' takes latest version of rail which is rails3 there are no script called server.

just try 'rails server '

fine,rails server is working for me…

     The output of  "rails server " from terminal is following

amrit@amrit-desktop:~/blog$ rails server => Booting WEBrick => Rails 3.0.1 application starting in development on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server [2010-10-23 02:08:11] INFO WEBrick 1.3.1 [2010-10-23 02:08:11] INFO ruby 1.9.2 (2010-08-18) [i686-linux] [2010-10-23 02:08:11] INFO WEBrick::HTTPServer#start: pid=1734 port=3000

Now i can access “localhost:3000”

                                i have downloaded the source code of site (openstreetview) which is rails application,now please tell me how to run this source code at localhost

Thanks

Your question has been answered and there was no problem with the Rails core. If you need further help, please consult the guides at http://guides.rubyonrails.org or join the #rubyonrails IRC channel.

NO ,Ben mills my question is still not solved Rails application which i create manually like

                   rails new blog
                                  and the content of the file  "blog/config/boot.rb" are

       require 'rubygems'

Set up gems listed in the Gemfile.

gemfile = File.expand_path(‘…/…/Gemfile’, FILE) begin ENV[‘BUNDLE_GEMFILE’] = gemfile require ‘bundler’ Bundler.setup rescue Bundler::GemNotFound => e STDERR.puts e.message STDERR.puts “Try running bundle install.” exit! end if File.exist?(gemfile)

                       Now cd blog
                              rails server             is working well and i can access the "localhost:3000" ,
                                     but i have downloaded the source code of site openstreetview (which is also rails application) in which the content of file OpenStreetView/config/boot.rb

are like

                   # Don't change this file!

Configure your app in config/environment.rb and config/environments/*.rb

RAILS_ROOT = “#{File.dirname(FILE)}/…” unless defined?(RAILS_ROOT)

module Rails class << self def boot! unless booted? preinitialize pick_boot.run end end

def booted?
  defined? Rails::Initializer
end

def pick_boot
  (vendor_rails? ? VendorBoot : GemBoot).new
end

def vendor_rails?
  File.exist?("#{RAILS_ROOT}/vendor/rails")
end

def preinitialize
  load(preinitializer_path) if File.exist?(preinitializer_path)
end

def preinitializer_path
  "#{RAILS_ROOT}/config/preinitializer.rb"
end

end

class Boot def run load_initializer Rails::Initializer.run(:set_load_path) end end

class VendorBoot < Boot def load_initializer require “#{RAILS_ROOT}/vendor/rails/railties/lib/initializer” Rails::Initializer.run(:install_gem_spec_stubs) Rails::GemDependency.add_frozen_gem_path end end

class GemBoot < Boot def load_initializer self.class.load_rubygems load_rails_gem require ‘initializer’ end

def load_rails_gem
  if version = self.class.gem_version
    gem 'rails', version
  else
    gem 'rails'
  end
rescue Gem::LoadError => load_error
  $stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.)
  exit 1
end

class << self
  def rubygems_version
    Gem::RubyGemsVersion rescue nil
  end

  def gem_version
    if defined? RAILS_GEM_VERSION
      RAILS_GEM_VERSION
    elsif ENV.include?('RAILS_GEM_VERSION')
      ENV['RAILS_GEM_VERSION']
    else
      parse_gem_version(read_environment_rb)
    end
  end

  def load_rubygems
    min_version = '1.3.2'
    require 'rubygems'
    unless rubygems_version >= min_version
      $stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
      exit 1
    end

  rescue LoadError
    $stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: [http://rubygems.rubyforge.org](http://rubygems.rubyforge.org))
    exit 1
  end

  def parse_gem_version(text)
    $1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
  end

  private
    def read_environment_rb
      File.read("#{RAILS_ROOT}/config/environment.rb")
    end
end

end end

All that for this:

Rails.boot!

                                Now cd OpenStreetView
                                rails server          gives the following error

Usage: rails new APP_PATH [options]

Options: -r, [–ruby=PATH] # Path to the Ruby binary of your choice # Default: /usr/local/bin/ruby -d, [–database=DATABASE] # Preconfigure for selected database (options: mysql/oracle/postgresql/sqlite3/frontbase/ibm_db) # 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.
                            

                                 why this is happening even both are the rails application .Please help me to run the server for openstreetview

Thanks for co-operation.

                   rails new blog
                                  and the content of the file

"blog/config/boot.rb" are

[...]

                                     but i have downloaded the source

code of site openstreetview (which is also rails application) in which the content of file OpenStreetView/config/boot.rb are like

[...]

Rails has had a major revision recently: Rails 3. The first generated application is Rails 3, according to its boot.rb that OpenStreetView is not Rails 3, things work differently.

Having said that, this mailing list is about the development of Rails itself. Your question would be more suited for a mailing list about using Ruby on Rails in general, such as rubyonrails-talk. You posted to both lists the first message, please stick to the other one, no need to follow the thread here.