Question

I'm upgrading my app from Rails 3.2 to Rails 4 and encountered this error when trying to start the server in development. Any thoughts on how to fix this?

/Users/timkleier/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/dependencies/autoload.rb:1:in `require': /Users/timkleier/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/inflector/methods.rb:128: undefined (?...) sequence: /\b(?<!['\342\200\231`])[a-z]/ (SyntaxError)
from /Users/timkleier/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/dependencies/autoload.rb:1
from /Users/timkleier/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support.rb:25:in `require'
from /Users/timkleier/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support.rb:25
from /Users/timkleier/.rvm/gems/ruby-2.0.0-p247/gems/actionpack-4.0.0/lib/action_dispatch.rb:24:in `require'
from /Users/timkleier/.rvm/gems/ruby-2.0.0-p247/gems/actionpack-4.0.0/lib/action_dispatch.rb:24
from /Users/timkleier/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/commands/server.rb:3:in `require'
from /Users/timkleier/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/commands/server.rb:3
from /Users/timkleier/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/commands.rb:72:in `require'
from /Users/timkleier/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/commands.rb:72
from script/rails:6:in `require'
from script/rails:6

Here's my Gemfile with the relevant gems:

source 'http://rubygems.org'

gem 'rails', '4.0.0'
gem 'activerecord'

gem 'execjs'
gem 'therubyracer'
gem "composite_primary_keys", :git => 'git://github.com/drnic/composite_primary_keys.git', :branch => 'ar_4.0.x'
gem "tiny_tds", "~> 0.5.1"

gem 'twitter-bootstrap-rails'
gem "less-rails"

gem 'sass-rails', '4.0.0'
gem 'uglifier', '2.1.1'
gem 'coffee-rails', '4.0.0'
gem 'jquery-rails', '2.2.1'

In config/application.rb, I have commented out Active Resource according to this post, but it seems to be unrelated.

Was it helpful?

Solution

The gsub where the syntax error is being produced includes Regexp syntax which isn't supported in < Ruby 1.9.3, and would produce this identical error in those versions, it seems. However, your paths show Ruby 2.0.0, which is odd, so I'm not entirely sure what's up.

Hopefully that gives you something to go on though, look at your Ruby install perhaps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top