2011-11-22 78 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运行,并成功部署到应用程序引擎。