0

I have a new application that is giving me errors when I do

rails server 

Here is the error:

/home/agenadinik/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.7/lib/rails/script_rails_loader.rb:11: warning: Insecure world writable dir /home/agenadinik in PATH, mode 040777 /home/agenadinik/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/runtime.rb:136: warning: Insecure world writable dir /home/agenadinik in PATH, mode 040777 => Booting WEBrick => Rails 3.0.7 application starting in development on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server Exiting /home/agenadinik/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.2/lib/rack/builder.rb:35:in `eval': /home/agenadinik/workspace/udfr/config.ru:6: syntax error, unexpected keyword_end, expecting ')' (SyntaxError) from /home/agenadinik/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.2/lib/rack/builder.rb:35:in `parse_file' from /home/agenadinik/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.2/lib/rack/server.rb:162:in `app' from /home/agenadinik/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.2/lib/rack/server.rb:248:in `wrapped_app' from /home/agenadinik/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.2/lib/rack/server.rb:213:in `start' from /home/agenadinik/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.7/lib/rails/commands/server.rb:65:in `start' from /home/agenadinik/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.7/lib/rails/commands.rb:30:in `block in <top (required)>' from /home/agenadinik/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.7/lib/rails/commands.rb:27:in `tap' from /home/agenadinik/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.7/lib/rails/commands.rb:27:in `<top (required)>' from script/rails:6:in `require' from script/rails:6:in `<main>' 

It seems to be complaining about my config.ru file. Here it is:

# This file is used by Rack-based servers to start the application. require ::File.expand_path('../config/environment', __FILE__) run Udfr::Application 

Here is my environment.rb file:

# Load the rails application require File.join(File.dirname(__FILE__), 'boot') require File.expand_path('../application', __FILE__) if RUBY_PLATFORM =~ /java/ require 'rubygems' RAILS_CONNECTION_ADAPTERS = %w(jdbc) end # Initialize the rails application Rails::Initializer.run do |config| Udfr::Application.initialize! 

I changed that file according to these instructions: http://www.digitalsanctum.com/2007/07/24/jruby-deploying-a-rails-application-on-tomcat/ Any idea what the problem is?

3
  • Can you include your environment.rb file as well? Commented Apr 26, 2011 at 23:54
  • 2
    Is that really your entire environment.rb file? It looks like it's missing an end at the end if it. Also: calling initialize! in it is wrong, that's not what environment.rb does... application.rb does that. Commented Apr 27, 2011 at 1:42
  • Appears to be some kind of syntax error in your file, most likely a bracket that has not been closed. You can test individual files to see if the Ruby interpreter can deal with them, for instance: ruby config.ru If it complains about something other than syntax, the syntax is valid. Commented Apr 27, 2011 at 1:54

1 Answer 1

1

The instructions you followed are for Rails 2 and will not work with your Rails 3 app.

The updated instructions for getting Ruby on Rails to work on jruby are to edit your gemfile and place your gem requirements there.

In Gemfile:

if defined?(JRUBY_VERSION) gem 'activerecord-jdbc-adapter' end 

Then run bundle.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.