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/agenadin开发者_运维知识库ik/.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?
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
.
精彩评论