#1 楼 @jimrokliu 好像听人说国外的服务,国内用着有问题?求考证!
#52 楼 @cassiuschen 哦。说的是 puma。以前安装 passenger 都对照着 passenger 和 nginx 的教程来配置,现在 puma 网上看不到如何连同 nginx 的配置,所有才问问。 那就单独先装好 nginx,然后在根据 puma remadme 的 config 就可以了。等我试试看。
#50 楼 @cassiuschen 哥们,有教程不,我也打算上 puma 了。
#2 楼 @wppurking 可以填充到本来的 form 里,但是如果还涉及一个分页的话,post 的话 form 里有值也用不上呢。
#1 楼 @PrideChung mac 没有 360 安全卫士,原来是 qq 的。坑爹。
#8 楼 @cassiuschen 这个太强了,在 windows2012 里面,vm 虚拟一个 2003。
#1 楼 @whitebox #2 楼 @gaicitadie 好吧。这个优势还真是坑,Rails 没法跑,估计在 windows 下跑个虚拟机好了。
我想知道做手机 api 接口,用 OAuth 2.0 是不是要比用 OAuth 1.0 要方便很多,我只用过 1,就感觉非常烦琐。
@Teddy 可是他是一大堆了。
#5 楼 @danielpowter 重点就在,怎么知道 id 为 bbb 的 div,因为隐藏了。 是指在源码找?如果是用库的话,还是用 gem,这招就不好使。
#12 楼 @jimrokliu 好吧,太坑了。找到问题了。
module API
class Base < Grape::API
prefix "api"
error_format :json #去掉这个就可以了,但是我不知道原因
format :json
#10 楼 @jimrokliu 刚刚试了,还是一样的问题,报一样的错误。
#8 楼 @jimrokliu 好吧。谢谢。 不用 grape 了,这个坑弄了 1 天都没弄好。怕以后还有坑,还是 controller jbuilder 吧。
#5 楼 @jimrokliu 我看 ruby china 的源码也没有加这个啊,实在不明白我这为什么会有这个错误。
#5 楼 @jimrokliu 没有加这个,刚刚加了试了,还是一样的错误: application.rb
require File.expand_path('../boot', __FILE__)
# Pick the frameworks you want:
require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
require "sprockets/railtie"
Bundler.require(:default, Rails.env)
module RepairFacility
class Application < Rails::Application
config.autoload_paths += %W(#{config.root}/lib)
config.paths.add "app/api", glob: "**/*.rb"
config.autoload_paths += Dir["#{Rails.root}/app/api/*"]
config.time_zone = 'Beijing'
config.i18n.default = "zh-CN"
if Rails.env.development?
ActiveSupport::Dependencies.explicitly_unloadable_constants << "API::Base"
api_files = Dir["#{Rails.root}/app/api/**/*.rb"]
api_reloader = ActiveSupport::FileUpdateChecker.new(api_files) do
Rails.application.reload_routes!
end
ActionDispatch::Callbacks.to_prepare do
api_reloader.execute_if_updated
end
end
end
end
application.rb
require File.expand_path('../boot', __FILE__)
require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
require "sprockets/railtie"
Bundler.require(:default, Rails.env)
module Rfacility
class Application < Rails::Application
# config.autoload_paths += %W(#{config.root}/lib)
# config.paths.add "app/api", glob: "**/*.rb"
# config.autoload_paths += Dir["#{Rails.root}/app/api/*"]
config.time_zone = 'Beijing'
config.i18n.default = "zh-CN"
end
end
错误一样:
rake aborted!
Rails::Application::RoutesReloader#execute_if_updated delegated to updater.execute_if_updated, but updater is nil: #<Rails::Application::RoutesReloader:0x007fe210e90aa8 @paths=["/rfacility/config/routes.rb"], @route_sets=[#<ActionDispatch::Routing::RouteSet:0x007fe2116a79f8>]>
/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:10:in `rescue in execute_if_updated'
/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:6:in `execute_if_updated'
/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application/finisher.rb:69:in `block in <module:Finisher>'
/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `instance_exec'
/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `run'
/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/initializable.rb:55:in `block in run_initializers'
/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/initializable.rb:54:in `run_initializers'
/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application.rb:215:in `initialize!'
/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
/rfacility/config/environment.rb:5:in `<top (required)>'
/.rvm/gems/ruby-2.0.0-p247/gems/backports-3.3.4/lib/backports/tools.rb:328:in `require'
/.rvm/gems/ruby-2.0.0-p247/gems/backports-3.3.4/lib/backports/tools.rb:328:in `require_with_backports'
/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `block in require'
/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application.rb:189:in `require_environment!'
/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application.rb:249:in `block in run_tasks_blocks'
/.rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:in `eval'
/.rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => routes => environment
(See full trace by running task with --trace)