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’,
:port => 26,
:domain => ‘mail.ordertonereasy.com’,
:authentication => :login,
:user_name => ‘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===========================