2011-11-22 79 views
2

我一直試圖讓應用程序引擎sdk無法正常工作。無法讓Jruby的google-appengine正常工作

我清空一個寶石,並通過執行

sudo gem install google-appengine

我有以下寶石安裝

[[email protected] GAE]$ sudo gem list 
Password: 

*** LOCAL GEMS *** 

appengine-apis (0.0.24) 
appengine-rack (0.0.13) 
appengine-sdk (1.4.3) 
appengine-tools (0.0.17) 
bundler08 (0.8.5) 
google-appengine (0.0.21) 
jruby-jars (1.5.6) 
jruby-rack (1.0.4) 
rack (1.3.5) 
rubyzip (0.9.4) 
[[email protected] GAE]$ 

並且如this教程(http://code.google.com/p/appengine-jruby/wiki/GettingStarted)我使用CRuby 提到安裝google-appengine寶石而不是Jruby

[[email protected] GAE]$ ruby -v 
ruby 1.9.3p0 (2011-10-30 revision 33570) [i686-linux] 

我在第一步驟本身

[[email protected] GAE]$ appcfg.rb generate_app hello 
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': iconv will be deprecated in the future, use String#encode instead. 
=> Generating gemfile 
/usr/lib/ruby/gems/1.9.1/gems/appengine-tools-0.0.17/lib/appengine-tools/gem_bundler.rb:63: warning: already initialized constant RUBY_ENGINE 
=> Bundling gems 
ERROR: While executing gem ... (RuntimeError) 
    Unknown command bundle 
[[email protected] GAE]$ 

安裝bundler(任一版本1.0.21或0.8)拋出相同的錯誤得到一個錯誤。

解決此問題的任何建議?

PS:我使用VirtualBox虛擬

+0

「我正在使用CRuby而不是Jruby」 - 您爲什麼期望它能正常工作?您只能在App Engine上使用Jruby,因此庫不太可能在CRuby上進行測試。 –

+1

如果您閱讀http://code.google.com/p/appengine-jruby/wiki/GettingStarted,明確提到使用標準ruby(Cr​​uby)而不是Jruby,這就是爲什麼我實際使用它,我嘗試過與jruby和它沒有工作 – Gautam

回答

2

首先你應該堅持使用Ruby 1.8.7。 1.9.x從來沒有真正在appengine-jruby上起飛,儘管這是可能的。此外,你應該使用Rubygems 1.3.7。

我當地的寶石是這些:

appengine-rack (0.0.13) 
appengine-sdk (1.4.3) 
appengine-tools (0.0.17) 
bundler (1.0.21) 
bundler08 (0.8.5) 
google-appengine (0.0.21) 
haml (3.1.4) 
jruby-jars (1.5.6) 
jruby-rack (1.0.4) 
rack (1.4.0) 
rubyzip (0.9.5) 
sass (3.1.12) 

但你猜怎麼着,除了谷歌,AppEngine上的寶石這些都不是真正重要的。更重要的是:ls .gems/bundler_gems/jruby/1.8/gems

addressable-2.2.7    extlib-0.9.15  multipart-post-1.1.5 
appengine-apis-0.0.22   faraday-0.7.6  oauth2-0.5.2 
appengine-rack-0.0.12   haml-3.1.4   rack-1.2.1 
Basaah-pony-gae-0.2.1   jruby-jars-1.5.6  rack-flash-0.1.2 
bouncy-castle-java-1.5.0146.1 jruby-openssl-0.7.2 sass-3.1.15 
dm-appengine-0.0.9    jruby-rack-1.0.5  sinatra-1.2.7 
dm-core-0.10.2     json_pure-1.6.5  tilt-1.3.3 
dm-validations-0.10.2   multi_json-1.1.0 

這至少會給你一個簡單的開始。 (您可以在Gemfile中配置版本)

順便說一句,您使用Linux很好。

1

嗯Arch Linux的...一個,我不知道你如何設置你的JRuby準確,或者您正在運行的JRuby的版本。你應該從內存的appengine上運行jruby 1.5.5。

我強烈建議這個指南:http://www.khelll.com/blog/ruby/google-app-engine-jruby-sinatra-and-some-fun/

後約3或4類似的指南,這是爲我工作的唯一配置。我在使用ssl時遇到了一些問題,但該應用程序使用應用程序引擎gem運行,併成功部署到應用程序引擎。