webrick start error in Ubuntu

Hi,

I'm running Ubuntu gutsy and am trying to get RoR running.

I followed the standard step by step installation of all the components and all seems to go well until I try to start WEBrick.

Here's what I've done:

1. install ruby from repositories -- OK ruby -v shows: ruby 1.8.6 (2007-06-07 patchlevel 36) [i486-linux]

2. get gems 1.0.1 and install (ruby setup.rb) -- OK gem -v shows: 1.0.1

3. install rails with dependencies -- OK rails -v shows: Rails 2.0.2

gem list *** LOCAL GEMS ***

actionmailer (2.0.2) actionpack (2.0.2) activerecord (2.0.2) activeresource (2.0.2) activesupport (2.0.2) rails (2.0.2) rake (0.8.1)

gem environment RubyGems Environment:   - RUBYGEMS VERSION: 1.0.1 (1.0.1)   - RUBY VERSION: 1.8.6 (2007-06-07 patchlevel 36) [i486-linux]   - INSTALLATION DIRECTORY: /usr/lib/ruby/gems/1.8   - RUBY EXECUTABLE: /usr/bin/ruby1.8   - RUBYGEMS PLATFORMS:     - ruby     - x86-linux   - GEM PATHS:      - /usr/lib/ruby/gems/1.8   - GEM CONFIGURATION:      - :update_sources => true      - :verbose => true      - :benchmark => false      - :backtrace => false      - :bulk_threshold => 1000   - REMOTE SOURCES:      - http://gems.rubyforge.org

4. create a new app with rails (rails new_app) -- OK 5. ruby start/server => Booting WEBrick... /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require': /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/helpers/active_record_helper.rb:211: syntax error, unexpected $end (SyntaxError)

      ^ from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'         from /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require'         from /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in'         from /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require'         from /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:227:in `load_helpers'         from /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:225:in `each'         from /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:225:in `load_helpers'         from /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view.rb:37          ... 29 levels...         from /usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39         from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'         from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'         from script/server:3

I've looked everywhere for a solution and I hope there's someone here that can help me because I'm out of ideas and places to look.

Thanks.

Luis Doubrava wrote:

5. ruby start/server => Booting WEBrick... /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require': /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/helpers/active_record_helper.rb:211: syntax error, unexpected $end (SyntaxError)

That seems to indicate something wrong with 'active_record_helper.rb', which definitely should not be a problem. Seems to me like it must have gotten corrupted on the install (for lack of any better guesses).

My suggestion is to 'gem uninstall' everything in your list except 'rake' and then re-run the 'gem install rails'.

Thanks for your response,

Jon Garvin wrote:

That seems to indicate something wrong with 'active_record_helper.rb', which definitely should not be a problem. Seems to me like it must have gotten corrupted on the install (for lack of any better guesses).

My suggestion is to 'gem uninstall' everything in your list except 'rake' and then re-run the 'gem install rails'.

I had already tried to uninstall/reinstall the gems with no luck.

So I decided to do a fresh Linux install and try it again.

Now I get: /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require': /usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/rails/plugin/loader.rb:86: syntax error, unexpected $end (SyntaxError)

        ^ from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'         from /usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/initializer.rb:9         from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'         from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'         from ./script/../config/boot.rb:54:in `load_initializer'         from ./script/../config/boot.rb:39:in `run'         from ./script/../config/boot.rb:11:in `boot!'         from ./script/../config/boot.rb:109         from script/server:2:in `require'         from script/server:2

My Environment is now: RubyGems Environment:   - RUBYGEMS VERSION: 1.1.1   - RUBY VERSION: 1.8.6 (2007-06-07 patchlevel 36) [i486-linux]   - INSTALLATION DIRECTORY: /usr/lib/ruby/gems/1.8   - RUBY EXECUTABLE: /usr/bin/ruby1.8   - RUBYGEMS PLATFORMS:     - ruby     - x86-linux   - GEM PATHS:      - /usr/lib/ruby/gems/1.8   - GEM CONFIGURATION:      - :update_sources => true      - :verbose => true      - :benchmark => false      - :backtrace => false      - :bulk_threshold => 1000   - REMOTE SOURCES:      - http://gems.rubyforge.org

And my gems list *** LOCAL GEMS ***

actionmailer (2.0.2) actionpack (2.0.2) activerecord (2.0.2) activeresource (2.0.2) activesupport (2.0.2) rails (2.0.2) rake (0.8.1)

I hope this error message makes more sense than the other one.

Thanks

Hi,

I was able to reproduce your problem, it is simply the fact that by using "rails my_app" to create a new app, you are implicitly creating an app that expects sqlite to run. I am sure sqlite is not installed on your system and thus generates this error.

If you already have mysql installed on your ubuntu box, use "rails my_app -d mysql", and you will create an app that runs with mysql, and it should work. If you want sqlite, then you will have to install it.