In two days Barkeley’s edx SaaS course is starting and I wanted to set up their rottenpotatoes RoR app on my machine without the VM they provided but I kept getting this error every time I tried to run “rails server” within the rottenpotatoes directory:
“/usr/lib/ruby/gems/1.9.1/gems/ruby-debug-base19-0.11.25/lib/ruby-debug-base.rb:1:in `require’: /usr/lib/ruby/gems/1.9.1/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.so: undefined symbol: ruby_current_thread – /usr/lib/ruby/gems/1.9.1/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.so (LoadError)”
Knowing almost nothing about working with RoR it took me a while to figure out why exactly this wouldn’t work and how to fix it. I tried installing a few different versions of ruby-debug and whatnot but nothing helped. Finally, I found this answer on StackOverflow which let me to the right rail. :D Apparently, ruby-debug19 and ruby-debug-base19 gems haven’t been updated in some time (and won’t any time soon) which already caused headaches for many people around the world.
To fix this simply install debugger (“Debugger is a fork of ruby-debug called ‘debugger’ and it incorporates many of the fixes people had been deploying on top of ruby-debug19.”) gem using:
gem install debugger
after that edit the following line from “Gemfile” file from your rottenpotatoes directory:
gem 'ruby-debug19', :require => 'ruby-debug'
gem 'debugger', :require => 'ruby-debug'
save the changes and run “rails server”. You should get this as the output:
=> Booting WEBrick
=> Rails 3.1.0 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2013-01-05 17:30:01] INFO WEBrick 1.3.1
[2013-01-05 17:30:01] INFO ruby 1.9.3 (2012-12-25) [i686-linux]
[2013-01-05 17:30:01] INFO WEBrick::HTTPServer#start: pid=3041 port=3000
and now you will be able to acces the rottenpotatoes app on http://localhost:3000/movies