我正在尝试部署我的Rails 3.0应用程序.我在FreeBSD生产服务器上使用rvm和ruby 1.9.2(p 180或p 290 - 没有区别).当我运行bundle命令时,我在每个:git gem上得到这个异常(似乎只有当我在Gemfile中使用带有:git选项的边缘版本时才会引发异常):
...
Installing has_scope (0.5.1)
Installing responders (0.6.4)
Using inherited_resources (1.2.2) from https://github.com/josevalim/inherited_resources.git (at master) /home/tmr/data/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1915:in `gsub': invalid byte sequence in US-ASCII (ArgumentError)
from /home/tmr/data/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1915:in `to_yaml'
from /home/tmr/data/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/builder.rb:79:in `block (2 levels) in write_package'
from /home/tmr/data/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/package/tar_output.rb:73:in `block (3 levels) in add_gem_contents'
from /home/tmr/data/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/package/tar_writer.rb:83:in `new'
from /home/tmr/data/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/package/tar_output.rb:67:in `block (2 levels) in add_gem_contents'
from /home/tmr/data/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/package/tar_output.rb:65:in `wrap'
from /home/tmr/data/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/package/tar_output.rb:65:in `block in add_gem_contents'
from /home/tmr/data/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/package/tar_writer.rb:113:in `add_file'
from /home/tmr/data/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/package/tar_output.rb:63:in `add_gem_contents'
from /home/tmr/data/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/package/tar_output.rb:31:in `open'
from /home/tmr/data/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/package.rb:44:in `open'
from /home/tmr/data/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/builder.rb:78:in `block …Run Code Online (Sandbox Code Playgroud) 我需要创建一个应用程序,它将数据保存在RDF存储中以供后续处理.我有几个解决方案,不知道该选择什么:
选择什么应用程序架构?可能是其他一些解决方案?
所有!也许有人知道为什么这样:
def index_link(object, content = t("#{object.to_s.pluralize}.index"))
#link_to(content, {:controller=>object.to_s.pluralize}, :scope=>"") if can?(:read, p(object)) #this doesn't work too
link_to(content, :controller=>"trademarks")
#link_to(content, trademarks_path) #this do work, but I need to set path from object
end
Run Code Online (Sandbox Code Playgroud)
像这样的例外:
No route matches {:controller=>"devise/trademarks"}
Run Code Online (Sandbox Code Playgroud)
堆:
actionpack (3.0.3) lib/action_dispatch/routing/route_set.rb:424:in `raise_routing_error'
actionpack (3.0.3) lib/action_dispatch/routing/route_set.rb:406:in `generate'
actionpack (3.0.3) lib/action_dispatch/routing/route_set.rb:453:in `generate'
actionpack (3.0.3) lib/action_dispatch/routing/route_set.rb:481:in `url_for'
actionpack (3.0.3) lib/action_dispatch/routing/url_for.rb:131:in `url_for'
actionpack (3.0.3) lib/action_view/helpers/url_helper.rb:99:in `url_for'
actionpack (3.0.3) lib/action_view/helpers/url_helper.rb:236:in `link_to'
app/helpers/application_helper.rb:53:in `index_link'
app/views/layouts/application.html.erb:20:in `_app_views_layouts_application_html_erb___741328535__615736668_0'
actionpack (3.0.3) lib/action_view/template.rb:135:in `send'
actionpack (3.0.3) lib/action_view/template.rb:135:in `render'
Run Code Online (Sandbox Code Playgroud)
以及如何使它工作?
我希望我的服务具有这样的功能:作者可以完全自定义页面,但不能窃取用户的cookie.
Tumblr遇到了一些麻烦,但成功解决了这些问题http://www.riyazwalikar.com/2012/07/stored-persistent-xss-on-tumblr.html
所以我需要解决方案
据我了解tumblr:
我可以为用户提供安全舒适的解决方案吗?cookie-theft是完全访问html的主要问题吗?
我需要使用可寻址的2.2.4 gem,但我有2.2.5版本(因为这里讨论了一个问题:https://github.com/sporkmonger/addressable/pull/33).我试过了:
source 'http://rubygems.org'
source 'http://gems.github.com'
gem "addresable", "2.2.4"
bundle install
Run Code Online (Sandbox Code Playgroud)
得到 Could not find gem 'adressable (= 2.2.4, runtime)' in any of the gem sources listed in your Gemfile.
如果我手动安装/卸载gem
sudo gem install addressable -v 2.2.4
sudo gem uninstall addressable -v 2.2.5
Run Code Online (Sandbox Code Playgroud)
我犯了同样的错误.
那么,我怎么能为我的应用强制2.2.4版本?
activerecord ×1
bundler ×1
deployment ×1
encoding ×1
helpers ×1
rdf ×1
rubygems ×1
security ×1
tumblr ×1
url-routing ×1
xss ×1