Created
October 21, 2010 20:57
-
-
Save samueldana/639339 to your computer and use it in GitHub Desktop.
Server setup issue using Nginx, RVM, Ruby-1.9.1, and Thin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
So, I'm setting up a new Ubuntu 10.04 server with nginx, RVM, Ruby-1.9.1, and Thin. | |
I got through installing nginx, RVM, ruby-1.9.1 without any problems. | |
Ruby-1.9.1 was installed using 'rvm install x'; | |
I don't have a system Ruby (Which is what I've been doing previously). | |
I've also set the default ruby to 1.9.1 for myself and root. | |
I installed the thin gem using 'gem install thin' | |
I then installed thin to the system using | |
'thin install' | |
and then | |
'/usr/sbin/update-rc.d -f thin defaults' | |
which makes a script /etc/init.d/thin that will run on startup. | |
When I rebooted the server, I got this message during startup: | |
/usr/local/rvm/rubies/ruby-1.9.1-p378/lib/ruby/site_ruby/1.9.1/rubygems.rb:779:in `report_activate_error': Could not find RubyGem thin (>= 0) (Gem::LoadError) | |
from /usr/local/rvm/rubies/ruby-1.9.1-p378/lib/ruby/site_ruby/1.9.1/rubygems.rb:214:in `activate' | |
from /usr/local/rvm/rubies/ruby-1.9.1-p378/lib/ruby/site_ruby/1.9.1/rubygems.rb:1082:in `gem' | |
from <internal:gem_prelude>:273:in `push_gem_version_on_load_path' | |
from <internal:gem_prelude>:14:in `gem' | |
from /usr/local/rvm/gems/ruby-1.9.1-p378/bin/thin:18:in `<main>' | |
After a bit of digging with IRB*, I got these values: | |
Gem.dir => "/usr/local/rvm/rubies/ruby-1.9.1-p378/lib/ruby/gems/1.9.1" | |
Gem.path => ["/root/.gem/ruby/1.9.1", "/usr/local/rvm/rubies/ruby-1.9.1-p378/lib/ruby/gems/1.9.1"] | |
* IRB was started like this: | |
rvm use system | |
/usr/local/rvm/rubies/ruby-1.9.1-p378/bin/ruby /usr/local/rvm/rubies/ruby-1.9.1-p378/bin/irb | |
So, rubygems is looking at <ruby_dir>/lib/ruby/gems/1.9.1 | |
Problem found! This directory doesn't exist. | |
The correct directory was <ruby_dir>/lib/ruby/gems/1.9 | |
Since I don't know how to change where Rubygems is looking (in a way that | |
won't break anything else), I took the cowards choice and created a symlink | |
cd <ruby_dir>/lib/ruby/gems/ | |
ln -s 1.9 1.9.1 | |
Problem solved... | |
BTW, thanks for all your great work on RVM! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this fixed the problem for me.
http://stackoverflow.com/questions/3230404/rvm-and-thin-root-vs-local-user