2011-08-16 20 views
1

我想安裝simple-private-messages gem(http://agilewebdevelopment.com/plugins/simple_private_messaging),https://github.com/jongilbraith/simple-private-messages如何在rubygems上找不到rubygems時在rails3中安裝gem/plugin?

我加入到我的Gemfile:

gem 'simple-private-messages' 

,但得到的錯誤:

Fetching source index for http://rubygems.org/ 
Could not find gem 'simple-private-messages (>= 0)' in any of the gem sources listed in your Gemfile. 

我又試圖修改的Gemfile到:

gem 'simple-private-messages', :git => 'git://github.com/professionalnerd/simple-private-messages.git' 

,但得到的錯誤:

Fetching git://github.com/professionalnerd/simple-private-messages.git 
github.com[0: 207.97.227.239]: errno=Operation timed out 
fatal: unable to connect a socket (Operation timed out) 
Git error: command `git clone 'git://github.com/professionalnerd/simple-private- messages.git' "/Users/homanchou/.rvm/gems/ruby-1.9.2-p180/cache/bundler/git/simple-private-messages-26451211e7d7acc0c1b523bad2621cb2cd38f77e" --bare --no-hardlinks` 

1)我該怎樣才能在本地安裝這個gem?

2)如果Heroku無法在任何存儲庫中找到gem,我該如何將此應用程序部署到heroku並防止部署錯誤?我是否將它們供應給應用程序?

回答

2

它看起來並不像是一個寶石;它實際上是一個Rails插件。

要安裝,在項目文件夾中運行以下命令:

rails plugin install git://github.com/jongilbraith/simple-private-messages.git 
+0

啊......忘了該命令。我認爲Rails 3使用Gemfile和bundler代替插件安裝,但是我認爲它仍然需要完成?我怎樣才能區分這種差異? – Homan

+0

一般來說,如果你在rubygems.org上搜索並找不到它,它可能不是寶石(或者至少不是已發佈的)。如果你看看github repo,並沒有看到gemspec文件,那將是另一個標誌。此外,該特定項目的自述文件確實表示將其安裝爲插件。 –