# Strange error on server startup

**URL:** <https://www.ruby-forum.com/t/strange-error-on-server-startup/129817>\
**Category:** Deployment\
**Created:** [February 21, 2008, 7:54pm UTC](https://www.ruby-forum.com/t/strange-error-on-server-startup/129817 "2008-02-21T19:54:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [February 21, 2008, 7:54pm UTC](https://www.ruby-forum.com/t/strange-error-on-server-startup/129817/1 "2008-02-21T19:54:37Z")

</div>

Hi,

This line in my environment.rb file is causing a syntax error …

require File.join(File.dirname( **FILE** ), ‘boot’)

Could someone tell me why? Here’s what happens when I try and start  
my server …

[me@mymachine]~/w/dps% ruby script/server  
=\> Booting WEBrick…  
/usr/local/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
`gem_original_require': /usr/local/apache2/htdocs/dps/config/ environment.rb:12: syntax error, unexpected tCONSTANT, expecting kDO or '{' or '(' (SyntaxError) require File.join(File.dirname( __FILE__ ), 'boot') ^ from /usr/local/lib/ruby/site_ruby/1.8/rubygems/ custom_require.rb:27:in `require’  
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/  
active\_support/dependencies.rb:496:in `require' from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/ active_support/dependencies.rb:342:in `new\_constants\_in’  
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/  
active\_support/dependencies.rb:496:in `require' from /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/ commands/servers/webrick.rb:59 from /usr/local/lib/ruby/site_ruby/1.8/rubygems/ custom_require.rb:27:in `gem\_original\_require’  
from /usr/local/lib/ruby/site\_ruby/1.8/rubygems/  
custom\_require.rb:27:in `require' from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/ active_support/dependencies.rb:496:in `require’  
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/  
active\_support/dependencies.rb:342:in `new_constants_in' from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/ active_support/dependencies.rb:496:in `require’  
from /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/  
commands/server.rb:39  
from /usr/local/lib/ruby/site\_ruby/1.8/rubygems/  
custom\_require.rb:27:in `gem_original_require' from /usr/local/lib/ruby/site_ruby/1.8/rubygems/ custom_require.rb:27:in `require’  
from script/server:3

Here’s the complete config/environment.rb file …  
================Begin config/environment.rb==========================

# Be sure to restart your web server when you modify this file.

# Uncomment below to force Rails into production mode when

# you don’t control web/app server and can’t set it the proper way

ENV[‘RAILS\_ENV’] ||= ‘production’

# Specifies gem version of Rails to use when vendor/rails is not

present  
RAILS\_GEM\_VERSION = ‘2.0.2’ unless defined?

# RAILS\_GEM\_VERSION = ‘2.0.2’

# Bootstrap the Rails environment, frameworks, and default

configuration  
require File.join(File.dirname( **FILE** ), ‘boot’)

Rails::Initializer.run do |config|  
config.action\_controller.session = { :session\_key =\>  
“\_myapp\_session”, :secret =\>  
“1a62136300db801aa3264d3b129ef6b8ec3a40f393311e114837b7b4df8e12c2470f2486af0f51161197b5dd75d3f3a3e127d4110849ba4a6cac2a44566c5840”  
}

# Settings in config/environments/\* take precedence over those

specified here

# Skip frameworks you’re not going to use (only works if using

vendor/rails)

# config.frameworks -= [:action\_web\_service, :action\_mailer]

# Only load the plugins named here, by default all plugins in vendor/

plugins are loaded

# config.plugins = %W( exception\_notification ssl\_requirement )

# Add additional load paths for your own custom dirs

# config.load\_paths += %W( #{RAILS\_ROOT}/extras )

# Force all environments to use the same logger level

# (by default production uses :info, the others :debug)

# config.log\_level = :debug

# Use the database for sessions instead of the file system

# (create the session table with ‘rake db:sessions:create’)

# config.action\_controller.session\_store = :active\_record\_store

# Use SQL instead of Active Record’s schema dumper when creating the

test database.

# This is necessary if your schema can’t be completely dumped by the

schema dumper,

# like if you have constraints or database-specific column types

# config.active\_record.schema\_format = :sql

# Activate observers that should always be running

# config.active\_record.observers = :cacher, :garbage\_collector

# Make Active Record use UTC-base instead of local time

# config.active\_record.default\_timezone = :utc

# See Rails::Configuration for more options

# ActionMailer settings

config.action\_mailer.delivery\_method = :smtp

config.action\_mailer.server\_settings = {  
:address =\> ‘[mail.ordertonereasy.com](http://mail.ordertonereasy.com)’,  
:port =\> 26,  
:domain =\> ‘[mail.ordertonereasy.com](http://mail.ordertonereasy.com)’,  
:authentication =\> :login,  
:user\_name =\> ‘[signup+ordertonereasy.com](http://signup+ordertonereasy.com)’,  
:password =\> ‘OrderItUp!’  
}

config.action\_mailer.raise\_delivery\_errors = false

end

require ‘spreadsheet/excel’

# Add new inflection rules using the following format

# (all these examples are active by default):

# Inflector.inflections do |inflect|

# inflect.plural /^(ox)$/i, ‘\1en’

# inflect.singular /^(ox)en/i, ‘\1’

# inflect.irregular ‘person’, ‘people’

# inflect.uncountable %w( fish sheep )

# end

# Add new mime types for use in respond\_to blocks:

# Mime::Type.register “text/richtext”, :rtf

# Mime::Type.register “application/x-mobile”, :mobile

# Include your application configuration below

=================End config/environment.rb===========================

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [February 21, 2008, 8:30pm UTC](https://www.ruby-forum.com/t/strange-error-on-server-startup/129817/2 "2008-02-21T20:30:45Z")

</div>

On Feb 21, 2008, at 10:54 AM, removed\_email\_address@domain.invalid wrote:

> `gem\_original\_require’: /usr/local/apache2/htdocs/dps/config/  
> environment.rb:12: syntax error, unexpected tCONSTANT, expecting kDO  
> or ‘{’ or ‘(’ (SyntaxError)

That’s probably the line that triggers the error from something that’s  
actually wrong above. What’s the environment.rb above that line?

-j
