Upgrading to Rails 4.0.0.beta1 Failed #9386

Closed
mdespuits opened this Issue Feb 23, 2013 · 15 comments

Projects

None yet

5 participants

@mdespuits
Contributor

I might be really naive about upgrading to Rails 4, but I am not sure where to start on this one.

  • Currently running Rails 3.2.12
  • Upgraded to gem 'rails', '4.0.0.beta', github: 'rails/rails' with all other necessasry updates.
  • Removed gems that are not compatible just to get the server up
  • Ran rails s
$ rails s
=> Booting WEBrick
=> Rails 4.0.0.beta application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
NameError: uninitialized constant DemoApp::Application::Railties
  • Ran ack Railties -a to no avail.

Ideas?

Thanks!

@mdespuits
Contributor

Also tried bundle exec rails s just to be sure...

@carlosantoniodasilva

Hm, might be related to some dependency, can you show the Gemfile and the full stack trace please? Also, have you tried running rake rails:update to update app files as well (like generating bin/rails and updating config/* files)?

@mdespuits
Contributor

There wasn't a stack track on it, unfortunately. It just stopped running. As far as running rake rails:update, I didn't even know that existed! I won't be able to try until Monday, so I'll ping back here after I do.

@mdespuits
Contributor

Updated to 4.0.0.beta1 and still getting the same error.

After some trial and error, I've narrowed the error down to the rubycas-client gem. When I have it defined in my Gemfile, I get that error. Otherwise (since my app depends on it), it will fail to require the right file.

@mdespuits mdespuits closed this Feb 26, 2013
@mdespuits
Contributor
demo_app $ rake rails:update --trace
rake aborted!
uninitialized constant DemoApp::Application::Railties
org/jruby/RubyModule.java:2677:in `const_missing'
/gem/full/path/to/railties-4.0.0.beta1/lib/rails/engine.rb:470:in `railties'
/gem/full/path/to/railties-4.0.0.beta1/lib/rails/application.rb:241:in `run_tasks_blocks'
/gem/full/path/to/railties-4.0.0.beta1/lib/rails/engine.rb:445:in `load_tasks'
org/jruby/RubyBasicObject.java:1659:in `__send__'
org/jruby/RubyKernel.java:2086:in `send'
/gem/full/path/to/railties-4.0.0.beta1/lib/rails/railtie/configurable.rb:30:in `method_missing'
/gem/full/path/to/demo_app/Rakefile:9:in `(root)'
org/jruby/RubyKernel.java:1046:in `load'
/gem/full/path/to/rake-10.0.3/lib/rake/rake_module.rb:1:in `(root)'
/gem/full/path/to/rake-10.0.3/lib/rake/rake_module.rb:25:in `load_rakefile'
/gem/full/path/to/rake-10.0.3/lib/rake/application.rb:583:in `raw_load_rakefile'
/gem/full/path/to/rake-10.0.3/lib/rake/application.rb:89:in `load_rakefile'
/gem/full/path/to/rake-10.0.3/lib/rake/application.rb:160:in `standard_exception_handling'
/gem/full/path/to/rake-10.0.3/lib/rake/application.rb:88:in `load_rakefile'
/gem/full/path/to/rake-10.0.3/lib/rake/application.rb:72:in `run'
/gem/full/path/to/rake-10.0.3/lib/rake/application.rb:160:in `standard_exception_handling'
/gem/full/path/to/rake-10.0.3/lib/rake/application.rb:70:in `run'
org/jruby/RubyKernel.java:1046:in `load'
/gem/full/binpath/to/bin/rake:23:in `(root)'

Sorry for the strange paths. Kinda sensitive where I work...

@mdespuits mdespuits reopened this Feb 26, 2013
@mdespuits
Contributor

@carlosantoniodasilva Doesn't seem to be a gem issue. Removed pretty much all gems and still am getting this issue when running rake rails:update

@mdespuits
Contributor

The extent of my Gemfile when running that command:

source "http://rubygems.org"

gem 'rails', '4.0.0.beta1'
gem 'rake', '10.0.3'

group :assets do
  gem 'sass-rails', '4.0.0.beta1'
end
@frodsan
Contributor
frodsan commented Feb 26, 2013

The same happens here with coffee-rails and JRuby https://travis-ci.org/rails/coffee-rails/jobs/5052898

@matt-hh
matt-hh commented Feb 26, 2013

Same issue here with latest rvm and jruby 1.7.3

A possible fix:

Move this line
https://github.com/rails/rails/blob/master/railties/lib/rails/application.rb#L58
to this file
https://github.com/rails/rails/blob/master/railties/lib/rails/engine.rb#L339

and it seems to work:

$ rails s
=> Booting WEBrick
=> Rails 4.0.0.beta1 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2013-02-26 13:31:34] INFO  WEBrick 1.3.1
[2013-02-26 13:31:34] INFO  ruby 1.9.3 (2013-02-21) [java]
[2013-02-26 13:31:34] INFO  WEBrick::HTTPServer#start: pid=8403 port=3000

another workaround: http://stackoverflow.com/questions/14527816/myappapplicationrailties-constant-missing-with-rails-4-beta-and-jruby-jruby

@carlosantoniodasilva

Weird, thanks for commenting, I'm bookmarking this to take a look.

@mdespuits
Contributor

@matt-hh I will be trying that line swap today. I'll report back the results

@mdespuits
Contributor

My output after @matt-hh's original fix. Seems to work.

$  bundle exec rails s
=> Booting WEBrick
=> Rails 4.0.0.beta1 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2013-02-26 10:10:23] INFO  WEBrick 1.3.1
[2013-02-26 10:10:23] INFO  ruby 1.9.3 (2013-01-04) [java]
[2013-02-26 10:10:23] INFO  WEBrick::HTTPServer#start: pid=10579 port=3000
@spastorino spastorino referenced this issue Feb 26, 2013
@timraymond timraymond Adding Back Rails::Engine::Railties#engines
Removing it breaks functionality with gems such as Thinking Sphinx.
This restores it with a deprecation warning. Closes #8551
48d5a33
@spastorino
Member

Isn't this https://gist.github.com/spastorino/a917b488cc6088cc4b34 enough to fix the issue?.
@mattdbridges can you test this patch?.

The issue is related to this #8551

@mdespuits
Contributor

@spastorino Confirmed. That patch fixes the load error.

@carlosantoniodasilva

Thank you ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment