Topic: (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

3) 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 `<main>'



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

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

well after visiting from no of blog ,i have solved this problem now i can show the welcome page at

                  localhost:3000

                                i have downloaded the source code of opensteetview(rails applcation ) , can anyone tell me how to run this source code at my computer


Thanks in advance again

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

If you use Rails 3.0 version, I suppose it's the case because you use its new syntax for creating a new application, you have to start the server as:

rails s or rails server

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

i used both i got follwoing message

amrit@amrit-desktop:~/blog$ rails server
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.

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

show us the result of the below commands(your ruby, rails version and gems environment:

ruby -v
rails -v
gem env

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

The result of
       1)   ruby-v is
                 
     ruby 1.9.2p0 (2010-08-18 revision 29036) [i686-linux]

2)rails -v is

Rails 3.0.1

3)gem env is
   
RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.7
  - RUBY VERSION: 1.9.2 (2010-08-18 patchlevel 0) [i686-linux]
  - INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.9.1
  - RUBY EXECUTABLE: /usr/local/bin/ruby
  - EXECUTABLE DIRECTORY: /usr/local/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-linux
  - GEM PATHS:
     - /usr/local/lib/ruby/gems/1.9.1
     - /home/amrit/.gem/ruby/1.9.1
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/

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

Everything seems to be OK. Try to create a new RoR aaplication as follows:

rails new draft_app

then navigate to the just created application:

cd draft_app

Run bundler:

bundle install

If everything is OK, run:

rails s

If the sever starts, by default it's Webrick that wil be started, navigate in your browser to http:/localhost:3000.
If there are some errors, post them here to see what happened and when.

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

i did as u said and it is working.now i can access "localhost:3000"
I have downloaded the source code of site openstreetview.org that is rails applcation site ..
Now can u suggest me how to run this source cod  at localhost ??


Thanks

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

Hi Javix, I have a similar error message, but not getting anything when typing rails -v

Problem:

gab:~ gabrielbeaudoin$ rails new draft_app
<internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- /Users/gabrielbeaudoin/config/boot (LoadError)
    from <internal:lib/rubygems/custom_require>:29:in `require'
    from script/rails:5:in `<main>'


ruby -v :

gab:~ gabrielbeaudoin$ ruby -v
ruby 1.9.2p136 (2010-12-25 revision 30365) [x86_64-darwin10.5.0]

rails -v:

gab:~ gabrielbeaudoin$ rails -v
<internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- /Users/gabrielbeaudoin/config/boot (LoadError)
    from <internal:lib/rubygems/custom_require>:29:in `require'
    from script/rails:5:in `<main>'

gem env:

gab:~ gabrielbeaudoin$ gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.7
  - RUBY VERSION: 1.9.2 (2010-12-25 patchlevel 136) [x86_64-darwin10.5.0]
  - INSTALLATION DIRECTORY: /Users/gabrielbeaudoin/.rvm/gems/ruby-1.9.2-p136
  - RUBY EXECUTABLE: /Users/gabrielbeaudoin/.rvm/rubies/ruby-1.9.2-p136/bin/ruby
  - EXECUTABLE DIRECTORY: /Users/gabrielbeaudoin/.rvm/gems/ruby-1.9.2-p136/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-darwin-10
  - GEM PATHS:
     - /Users/gabrielbeaudoin/.rvm/gems/ruby-1.9.2-p136
     - /Users/gabrielbeaudoin/.rvm/gems/ruby-1.9.2-p136@global
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/

Before, i did the sudo gem install rails:

gab:/ gabrielbeaudoin$ sudo gem install rails
Successfully installed activesupport-3.0.3
Successfully installed builder-2.1.2
Successfully installed i18n-0.5.0
Successfully installed activemodel-3.0.3
Successfully installed rack-1.2.1
Successfully installed rack-test-0.5.6
Successfully installed rack-mount-0.6.13
Successfully installed tzinfo-0.3.23
Successfully installed abstract-1.0.0
Successfully installed erubis-2.6.6
Successfully installed actionpack-3.0.3
Successfully installed arel-2.0.6
Successfully installed activerecord-3.0.3
Successfully installed activeresource-3.0.3
Successfully installed mime-types-1.16
Successfully installed polyglot-0.3.1
Successfully installed treetop-1.4.9
Successfully installed mail-2.2.13
Successfully installed actionmailer-3.0.3
Successfully installed thor-0.14.6
Successfully installed railties-3.0.3
Successfully installed bundler-1.0.7
Successfully installed rails-3.0.3
23 gems installed
Installing ri documentation for activesupport-3.0.3...
Installing ri documentation for builder-2.1.2...
Installing ri documentation for i18n-0.5.0...
Installing ri documentation for activemodel-3.0.3...
Installing ri documentation for rack-1.2.1...
Installing ri documentation for rack-test-0.5.6...
Installing ri documentation for rack-mount-0.6.13...
Installing ri documentation for tzinfo-0.3.23...
Installing ri documentation for abstract-1.0.0...
Installing ri documentation for erubis-2.6.6...
Installing ri documentation for actionpack-3.0.3...
Installing ri documentation for arel-2.0.6...
Installing ri documentation for activerecord-3.0.3...
Installing ri documentation for activeresource-3.0.3...
Installing ri documentation for mime-types-1.16...
Installing ri documentation for polyglot-0.3.1...
Installing ri documentation for treetop-1.4.9...
Installing ri documentation for mail-2.2.13...
Installing ri documentation for actionmailer-3.0.3...
Installing ri documentation for thor-0.14.6...
Installing ri documentation for railties-3.0.3...
Installing ri documentation for bundler-1.0.7...
Installing ri documentation for rails-3.0.3...
Installing RDoc documentation for activesupport-3.0.3...
Installing RDoc documentation for builder-2.1.2...
Installing RDoc documentation for i18n-0.5.0...
Installing RDoc documentation for activemodel-3.0.3...
Installing RDoc documentation for rack-1.2.1...
Installing RDoc documentation for rack-test-0.5.6...
Installing RDoc documentation for rack-mount-0.6.13...
Installing RDoc documentation for tzinfo-0.3.23...
Installing RDoc documentation for abstract-1.0.0...
Installing RDoc documentation for erubis-2.6.6...
Installing RDoc documentation for actionpack-3.0.3...
Installing RDoc documentation for arel-2.0.6...
Installing RDoc documentation for activerecord-3.0.3...
Installing RDoc documentation for activeresource-3.0.3...
Installing RDoc documentation for mime-types-1.16...
Installing RDoc documentation for polyglot-0.3.1...
Installing RDoc documentation for treetop-1.4.9...
Installing RDoc documentation for mail-2.2.13...
Installing RDoc documentation for actionmailer-3.0.3...
Installing RDoc documentation for thor-0.14.6...
Installing RDoc documentation for railties-3.0.3...
Installing RDoc documentation for bundler-1.0.7...
Installing RDoc documentation for rails-3.0.3...

so i thought that rails -v would be working... but no. Can you help me with that ? Thank you

gabo

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

I to kinda get this error.

RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.7
  - RUBY VERSION: 1.9.2 (2010-08-18 patchlevel 0) [x86_64-darwin10.5.0]
  - INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.9.1
  - RUBY EXECUTABLE: /usr/local/bin/ruby19
  - EXECUTABLE DIRECTORY: /usr/local/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-darwin-10
  - GEM PATHS:
     - /usr/local/lib/ruby/gems/1.9.1
     - /Users/gethernm/.gem/ruby/1.9.1
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/


rails s
/Library/Ruby/Gems/1.8/gems/railties-3.0.3/lib/rails/script_rails_loader.rb:11: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040757
Could not find i18n-0.5.0 in any of the sources
Try running `bundle install`.


I do bundle install again and still same error. I dont know why i get this error. I feel like rails is trying to use the gems in /Library/Ruby/Gems/1.8/gems when i was on ruby 1.8 but i would like to move to ruby 1.9. After upgrading this has started to happen.

Any Help would be great

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

@amritpalpathak:
First you should the Rails version used for the application you had downloaded. Even looking at the structure of the application. If it is of Rails >=3.0, so just navigate to the application folder and run:

bundle install

to install all the gems needed for the application. If the user Rails version <3.0 you will have to install all the needed gem either manually or with rake. It depends if those gems were put in 'environment.rb' file. If it is the case just run:

rake gems:install

see more information here