0

After following instructions on this stackoverflow I was able to get it working on local machine. I even installed the gems on the deployment server and can run the server there locally.

Rails with ruby-debugger throw 'Symbol not found: _ruby_current_thread (LoadError)'

For deploying we are using Capistrano and the issue is that the Gemfile contains the following:

gem 'linecache19', '0.5.13', :path => "~/.rvm/gems/ruby-1.9.3-p#{RUBY_PATCHLEVEL}/gems/linecache19-0.5.13/"
gem 'ruby-debug-base19', '0.11.26', :path => "~/.rvm/gems/ruby-1.9.3-p#{RUBY_PATCHLEVEL}/gems/ruby-debug-base19-0.11.26/"

Because RUBY_PATCHLEVEL is different on server and my local machine it adds my local machines path to the Gemfile.lock and on the server it tries to find the gem there but it cant because the patch is different.

Below is the stack trace

You are trying to install in deployment mode after changing your Gemfile. Run bundle install elsewhere and add the updated Gemfile.lock to version control.

You have added to the Gemfile:
* source: source at ~/.rvm/gems/ruby-1.9.3-p125/gems/ruby-debug-base19-0.11.26/
* source: source at ~/.rvm/gems/ruby-1.9.3-p125/gems/linecache19-0.5.13/

My local machine ruby version is 1.9.3-p194 and server has 1.9.3-p125. How can I fix this?

Community
  • 1
  • 1
Encore PTL
  • 8,084
  • 10
  • 43
  • 78
  • Check out http://stackoverflow.com/questions/6438116/rails-with-ruby-debugger-throw-symbol-not-found-ruby-current-thread-loaderro ; the same error back trace is handled there. – Prakash Murthy Oct 20 '12 at 06:35
  • I tried that and now it works on my local machine and on server but when deploying using capistrano it fails and throws as error that no gem found at path. The issue is that the patch version of ruby is different on local machine than on the remote host – Encore PTL Oct 20 '12 at 18:54
  • Cool. Could you update the question with the full stacktrace of the new error please? Would be helpful to describe the changes you made as well. – Prakash Murthy Oct 20 '12 at 18:59
  • Added an answer to this issue. Note: That was a totally different issue from the original one; preferred way would have been to add a new question. – Prakash Murthy Oct 20 '12 at 19:25

1 Answers1

0

Use '.rvmrc file to specify that the project should use the same RUBY_PATCHLEVEL on both the dev & the prod server.

Create a file named .rvmrc in the main folder of the application with the following line:

rvm use 1.9.3-p125

That would make the project use the specified patch version.

Of course, that means that you have to install 1.9.3-p125 version locally; rvm is exactly for that purpose - to manage multiple versions of ruby on the local machine.

I usually have project specific gemsets as well, and my .rvmrc file looks as follows:

rvm_gemset_create_on_use_flag=1
rvm use <ruby version>@<gemset name ; usually the project name>

Example

rvm_gemset_create_on_use_flag=1
rvm use 1.9.3@myblog
Prakash Murthy
  • 12,923
  • 3
  • 46
  • 74