Sinatra Gem Won't Install

我们两清 提交于 2019-12-25 02:19:40

问题


I am running Ubuntu 10.04 on a linode trying to get sinatra, passenger, nginx, and rvm to all play nice with Ruby 1.9.2. I'm running into an issue with gems though:

~/.rvm/gems/ruby-1.9.2-p290/gems$ ls returns

daemon_controller-0.2.6  fastthread-1.0.7  passenger-3.0.9  rack-1.3.2  rake-0.9.2

and gem list returns

*** LOCAL GEMS ***

rack (1.3.2)
rake (0.9.2)
sinatra (1.2.6)
tilt (1.3.3)

What is odd to me is that they aren't the same. And sinatra is missing from the .rvm gems.

When I go to my website I get the following:

Error message:
no such file to load -- sinatra

with /home/noahc/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb on line 36 inrequire'`

Any ideas? Thanks!


回答1:


It seems that you have a problem with your rvm gemset not beeing used.

First, cd /yourprojectdir and create a .rvmrc and matching gemset for your project

rvm --rvmrc --create 1.9.2@yourprojectname

Then make sure you are using the gemset

rvm gemset list

The arrow should point to your gemset, if it's not do rvm gemset use yourprojectname.

Now install your gems with gem install, or - better - bundle install.

Passenger 3 should detect your .rvmrc and use the correct gemset automatically.



来源:https://stackoverflow.com/questions/7310050/sinatra-gem-wont-install

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!