最后怎么解决的呢?
@kayakjiang 好的,非常感谢。我试试去。
请问一下,比如我增加了一个 lib/tasks/jd.rake 任务,在这个 jd.rake 任务,我定义了 task1 和 task2,运行成功后。发现这些逻辑可以用,然后我想把这里的 rake 任务写到 MVC 里,应该怎么操作呢? 在 rake 里写的任务和在 mvc 里写的有哪些区别呢?
最后想出个了个办法,把 2.1.1 版本里的 bin 文件,换成 2.0.0 版本的 bin 文件,其它地方都不变,于是出现了一下的情况
2.0.0 版本的 bin 从这里下载,因为这里下载下来的文件只有 bin 和 examples 两个文件
2.1.1 版本的超级好安装~~~再次感觉被折腾的够呛
@nightire 非常感谢。 我的 xcode 已经是最新版本了【Version 8.1 (8B62)】 我要怎么修改呢?感谢!
@novtopro thanks very much. I try running /usr/bin/xcodebuild
, but it doesn't work. and I follow this http://stackoverflow.com/questions/33728905/qt-creator-project-error-xcode-not-set-up-properly-you-may-need-to-confirm-t change my code, it doesn't work too.
重新跑了以上两个命令还是不行。@kayakjiang 非常感谢!
请教一下大家 slate 的 API 文档是如何实现的呢?以下是做出来的效果图,以及代码。全部的代码在https://github.com/panxiubin/build-an-api-rails-demo-2 自己找了好几遍还是不知道问题出在哪里。。。
@kayakjiang 恩恩,方法很重要,要不永远都不会前进。感谢!又搜到了你的一篇好文《Web 安全和 Rails》 感谢!
谢谢楼主的耐心回答,回顾自己的行为确实过于急躁。没能静下心来看问题,并且合理的提出问题,完全是一个不合格的提问者。(楼主完全可以无视我的问题,那样的话我也只能一个人纠结去)也没能及时对楼主表达感谢。借此次回复真诚的表达感谢,楼主的那篇用 Rails 写 API 的文章是我入门的资料。 再次感谢楼主的付出以及在这里对我的提醒,面对技术问题,在下次提问的时候一定自己先想清楚并表达清楚自己遇到的问题是什么。感谢!
@kayakjiang 好的,可以实现 403 Forbidden 了,非常感谢。
@kayakjiang 以上是日志,非常感谢
Rendered /Users/panxiubin/.rvm/gems/ruby-2.2.0/gems/actionpack-4.2.1/lib/action_dispatch/middleware/templates/rescues/_source.erb (4.2ms)
Rendered /Users/panxiubin/.rvm/gems/ruby-2.2.0/gems/actionpack-4.2.1/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (2.0ms)
Rendered /Users/panxiubin/.rvm/gems/ruby-2.2.0/gems/actionpack-4.2.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (1.0ms)
Rendered /Users/panxiubin/.rvm/gems/ruby-2.2.0/gems/actionpack-4.2.1/lib/action_dispatch/middleware/templates/rescues/missing_template.html.erb within rescues/layout (43.2ms)
Rendered /Users/panxiubin/.rvm/gems/ruby-2.2.0/gems/web-console-2.3.0/lib/web_console/templates/_markup.html.erb (0.2ms)
Rendered /Users/panxiubin/.rvm/gems/ruby-2.2.0/gems/web-console-2.3.0/lib/web_console/templates/_inner_console_markup.html.erb within layouts/inlined_string (0.5ms)
Rendered /Users/panxiubin/.rvm/gems/ruby-2.2.0/gems/web-console-2.3.0/lib/web_console/templates/_prompt_box_markup.html.erb within layouts/inlined_string (0.2ms)
Rendered /Users/panxiubin/.rvm/gems/ruby-2.2.0/gems/web-console-2.3.0/lib/web_console/templates/style.css.erb within layouts/inlined_string (0.4ms)
Rendered /Users/panxiubin/.rvm/gems/ruby-2.2.0/gems/web-console-2.3.0/lib/web_console/templates/console.js.erb within layouts/javascript (39.0ms)
Rendered /Users/panxiubin/.rvm/gems/ruby-2.2.0/gems/web-console-2.3.0/lib/web_console/templates/main.js.erb within layouts/javascript (0.2ms)
Rendered /Users/panxiubin/.rvm/gems/ruby-2.2.0/gems/web-console-2.3.0/lib/web_console/templates/error_page.js.erb within layouts/javascript (0.3ms)
Rendered /Users/panxiubin/.rvm/gems/ruby-2.2.0/gems/web-console-2.3.0/lib/web_console/templates/index.html.erb (82.2ms)
Started GET "/api/v1/users/2.json" for ::1 at 2016-11-14 16:30:32 +0800
Processing by Api::V1::UsersController#show as JSON
Parameters: {"id"=>"2"}
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1[0m [["id", 2]]
Rendered api/v1/users/show.json.jbuilder (1.9ms)
Completed 200 OK in 7ms (Views: 5.8ms | ActiveRecord: 0.1ms)
Started PUT "/api/v1/users/2" for ::1 at 2016-11-14 16:37:59 +0800
Processing by Api::V1::UsersController#update as */*
Parameters: {"id"=>"2"}
Can't verify CSRF token authenticity
Rendered text template (0.0ms)
Filter chain halted as :authenticate_user! rendered or redirected
Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)
Started PUT "/api/v1/users/2" for ::1 at 2016-11-14 16:38:42 +0800
Processing by Api::V1::UsersController#update as */*
Parameters: {"id"=>"2"}
Can't verify CSRF token authenticity
Rendered text template (0.0ms)
Filter chain halted as :authenticate_user! rendered or redirected
Completed 401 Unauthorized in 1ms (Views: 0.2ms | ActiveRecord: 0.0ms)
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1[0m
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users"
[1m[36mUser Load (0.2ms)[0m [1mSELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1[0m
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1
Started PUT "/api/v1/users/2.json" for ::1 at 2016-11-14 17:10:53 +0800
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
Processing by Api::V1::UsersController#update as JSON
Parameters: {"user"=>{"name"=>"gg-user"}, "id"=>"2"}
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1 [["email", "[email protected]"]]
Rendered text template (0.0ms)
Filter chain halted as :authenticate_user! rendered or redirected
Completed 401 Unauthorized in 21ms (Views: 3.6ms | ActiveRecord: 0.4ms)
Started PUT "/api/v1/users/2" for ::1 at 2016-11-14 17:11:43 +0800
Processing by Api::V1::UsersController#update as */*
Parameters: {"id"=>"2"}
Rendered text template (0.0ms)
Filter chain halted as :authenticate_user! rendered or redirected
Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)
Started PUT "/api/v1/users/2.json" for ::1 at 2016-11-14 17:21:28 +0800
Processing by Api::V1::UsersController#update as JSON
Parameters: {"user"=>{"name"=>"gg-user"}, "id"=>"2"}
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1[0m [["email", "[email protected]"]]
Rendered text template (0.0ms)
Filter chain halted as :authenticate_user! rendered or redirected
Completed 401 Unauthorized in 7ms (Views: 0.5ms | ActiveRecord: 0.5ms)
Started PUT "/api/v1/users/2" for ::1 at 2016-11-14 17:24:32 +0800
Processing by Api::V1::UsersController#update as */*
Parameters: {"user"=>{"name"=>"gg-user"}, "id"=>"2"}
[1m[35mUser Load (0.1ms)[0m SELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1 [["email", "[email protected]"]]
Rendered text template (0.0ms)
Filter chain halted as :authenticate_user! rendered or redirected
@kayakjiang 一直返回的是 401Unauthorized,而不是 403 Forbidden,我这里是哪里错了呢?谢谢
403 的报错一直出不来,多谢指教@kayakjiang
请大神,在增加授权那一节一直过不去,有没有一些更详细的解析呢?
在 session controller 中,
# 我们使用 jbuilder
# render(
# json: Api::V1::SessionSerializer.new(user, root: false).to_json,
# status: 201
# )```
这段话不是已经注释掉了吗?为什么如果我不加的话,会出现报错呢,加了就好了
支持!
图片好漂亮,挖走了😝
不知道国庆后的招聘是不是已经开始了呢?
VR
@jasl 谢谢大神
@lgn21st 谢谢支持我们
厉害,landing page 可以再好一点
每个人都有选择的权利
想去~~
到场的人手一件吗?