我安装插件open_id_authentication并出现此错误:
/usr/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0.beta/lib/active_support/dependencies.rb:167:in `require': no such file to load -- rack/openid (LoadError)
Run Code Online (Sandbox Code Playgroud)
当我尝试启动时rails server
,在我的系统中安装了rack-openid,我可以从irb加载它:
irb(main):001:0> require 'rack/openid'
=> true
Run Code Online (Sandbox Code Playgroud)
我尝试像使用ruby-openid一样添加hack到Gemfile,但它没有帮助:
gem "ruby-openid", :require => "openid"
gem "rack-openid", :require => "rack/openid"
Run Code Online (Sandbox Code Playgroud)
我也试过了
gem "ruby-openid", :require => "rack/openid"
Run Code Online (Sandbox Code Playgroud)
但:
/usr/lib/ruby/gems/1.9.1/gems/bundler-0.9.7/lib/bundler/runtime.rb:38:in `require': no such file to load -- rack/openid (LoadError)
Run Code Online (Sandbox Code Playgroud)
在rails 2.3.5 app中没有这个问题,我无法理解为什么它会在Rails 3中发生.
我有几个复杂的查询(使用子查询等...)并希望将它们与OR或AND语句粘合在一起.
例如:
where1=table.where(...)
where2=table.where(...)
Run Code Online (Sandbox Code Playgroud)
我想要的东西
where3=where1.or where2
Run Code Online (Sandbox Code Playgroud)
下一个示例对我不起作用:
users.where(users[:name].eq('bob').or(users[:age].lt(25)))
Run Code Online (Sandbox Code Playgroud)
因为我有几个where(..)查询,我想连接它们.
换一种说法
我有3个方法:首先返回第一个,第二个,第三个 - 或者连接.
我必须能够在我的应用程序中使用所有3种方法并保存DRY代码
我只是安装了rails 3以及它需要的所有gem,但是当我尝试启动服务器时,它会说出启动脚本中的问题.
[rap-kasta@acerAspire testR3]$ script/rails server
/home/rap-kasta/tmp/testR3/config/boot.rb:7:in `rescue in <top (required)>': uninitialized constant Bundler (NameError)
from /home/rap-kasta/tmp/testR3/config/boot.rb:2:in `<top (required)>'
from script/rails:9:in `require'
from script/rails:9:in `<main>
Run Code Online (Sandbox Code Playgroud)
所以,我试图重新安装Bundler,安装"pre"-version(但实际上它的版本号低于我安装的版本号 gem install bundler
现在系统中有下一个宝石:
abstract (1.0.0)
actionmailer (3.0.0.beta, 2.3.5, 2.3.4)
actionpack (3.0.0.beta, 2.3.5, 2.3.4)
activemodel (3.0.0.beta)
activerecord (3.0.0.beta, 2.3.5, 2.3.4)
activeresource (3.0.0.beta, 2.3.5, 2.3.4)
activesupport (3.0.0.beta, 2.3.5, 2.3.4)
arel (0.2.1, 0.2.pre)
builder (2.1.2)
bundler (0.9.5)
erubis (2.6.5)
fxri (0.3.7)
fxruby (1.6.20)
i18n (0.3.3)
jemini (2010.1.24, 2010.1.5)
mail (2.1.2)
memcache-client (1.7.8)
mime-types (1.16)
mysql (2.8.1) …Run Code Online (Sandbox Code Playgroud)