Sinatra宝石不会安装 [英] Sinatra Gem Won't Install
问题描述
我在一个linode上运行Ubuntu 10.04,试图让sinatra,passenger,nginx和rvm与Ruby 1.9.2搭配使用。尽管我遇到了一个与宝石有关的问题:
〜/ .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
code>
和宝石列表
退货
***本地GEMS ***
rack(1.3.2)
rake(0.9.2)
sinatra(1.2.6)
倾斜(1.3.3)
我觉得奇怪的是它们不一样。
当我访问我的网站时,我收到以下内容:
错误信息:
没有要加载的文件 - sinatra
与 /home/noahc/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb in line 36 in code> require'`
有什么想法?谢谢!
似乎你的rvm gemset没有被使用过。
首先, cd / yourprojectdir
并为您的项目创建一个 .rvmrc
和匹配的gemset
rvm --rvmrc --create 1.9.2@yourprojectname
然后确保您使用的是gemset
rvm gemset list
箭头应指向您的gemset,如果它不是 rvm gemset use yourprojectname
。
现在用 gem install
来安装您的宝石,或者 - better - bundle install
。
Passenger 3应该检测到你的 .rvmrc
和自动使用正确的宝石。
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 in
require'`
Any ideas? Thanks!
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.
这篇关于Sinatra宝石不会安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!