rails application fails to start
I am trying to setup my rails application on my vps running ubuntu 10. I am using passenger with apache to run my app. When I try to go to my application url, I get the error, "ruby (rack) application could not be started. Missing rails 2.3.8 gem"
I have the gem installed. So, to debug a little more, I put a print statement in boot.rb to see where it is looking for the rails gem and this is what the gem path it printed:
/home/mahesh/.gem/ruby/1.8/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8
In the command line, I ran gem env and the gem path output is:
- /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8
- /home/mahesh/.gem/ruby/1.8
I don't know how the gem path is getting messed up. It looks like it is appending the two gem paths.
In my .bashrc, I have
GEM_PATH=/opt/ruby-enterprise-1.8.7-20开发者_高级运维10.02/lib/ruby/gems/1.8/gems
I am stuck. I would really appreciate if someone can help me figure this out. thanks!
It turned out to be a conflict with rack gem versions. I had 1.1.0 and 1.2.1 installed. I removed 1.2.1 and everything works fine now!
I've always had luck running Ruby interpreters and gems galore with RVM - you might try setting that up and installing REE through that. Keep in mind when you install gems with RVM you don't use sudo. Installation guide is here:
- https://rvm.io/rvm/install/
There are some Ubuntu-specific notes here:
- https://rvm.io/os/ubuntu/
Hope that helps!
精彩评论