defipanda / elixir-china Goto Github PK
View Code? Open in Web Editor NEW这个项目因为时间原因已经暂停维护
这个项目因为时间原因已经暂停维护
首页被污染了啊
http://elixir-cn.com/
而不是帖子本身的发布时间。。。。
每次都要登录,是我人品不行?
不然把secret放在github上会被session hijack
现在的textarea只能文字
这也太烂一点了吧。。。。。。
比如在主页有“jw2013 于 2015-1-6 15点23分 最后更新”,其实我们想说的是
“jw2013发的帖子 于 2015-1-6 15点23分 最后更新”
应该把所有项目里“xxx 于 2015-1-6 15点23分 最后更新”改为“xxx的帖子 于 2015-1-6 15点23分 最后更新”
▶ mix elixir-china.server
==> bcrypt (compile)
Compiling c_src/async_queue.c
In file included from c_src/async_queue.c:32:0:
c_src/async_queue.h:45:21: fatal error: erl_nif.h: No such file or directory
#include <erl_nif.h>
^
compilation terminated.
ERROR: compile failed while processing /home/qwerty/workspace/elixir-china/deps/bcrypt: rebar_abort
** (Mix) Could not compile dependency bcrypt, /home/qwerty/.mix/rebar command failed. If you want to recompile this dependency, please run: mix deps.compile bcrypt
`== Compilation error on file web/router.ex ==
** (CompileError) web/router.ex: internal error in v3_core;
crash reason: {case_clause,
{'EXIT',
{badarg,
[{erl_anno,anno_info,[-1],[{file,"erl_anno.erl"},{line,360}]},
{v3_core,record_anno,2,[{file,"v3_core.erl"},{line,2410}]},
{v3_core,expr,2,[{file,"v3_core.erl"},{line,539}]},
{v3_core,safe,2,[{file,"v3_core.erl"},{line,1593}]},
{v3_core,expr,2,[{file,"v3_core.erl"},{line,528}]},
{v3_core,safe,2,[{file,"v3_core.erl"},{line,1593}]},
{v3_core,'-safe_list/2-anonymous-0-',2,
[{file,"v3_core.erl"},{line,1608}]},
{lists,foldr,3,[{file,"lists.erl"},{line,1276}]},
{v3_core,expr,2,[{file,"v3_core.erl"},{line,538}]},
{v3_core,safe,2,[{file,"v3_core.erl"},{line,1593}]},
{v3_core,'-safe_list/2-anonymous-0-',2,
[{file,"v3_core.erl"},{line,1608}]},
{lists,foldr,3,[{file,"lists.erl"},{line,1276}]},
{v3_core,expr,2,[{file,"v3_core.erl"},{line,538}]},
{v3_core,safe,2,[{file,"v3_core.erl"},{line,1593}]},
{v3_core,expr,2,[{file,"v3_core.erl"},{line,528}]},
{v3_core,safe,2,[{file,"v3_core.erl"},{line,1593}]},
{v3_core,'-safe_list/2-anonymous-0-',2,
[{file,"v3_core.erl"},{line,1608}]},
{lists,foldr,3,[{file,"lists.erl"},{line,1276}]},
{v3_core,expr,2,[{file,"v3_core.erl"},{line,652}]},
{v3_core,exprs,2,[{file,"v3_core.erl"},{line,512}]}]}}}
in function compile:'-select_passes/2-anonymous-2-'/2 (compile.erl, line 536)
in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, line 321)
in call from compile:fold_comp/3 (compile.erl, line 347)
in call from compile:internal_comp/4 (compile.erl, line 331)
in call from compile:'-do_compile/2-anonymous-0-'/2 (compile.erl, line 179)
(stdlib) lists.erl:1338: :lists.foreach/2
(phoenix) expanding macro: Phoenix.Router.before_compile/1
web/router.ex:1: ElixirChina.Router (module)
(elixir) lib/kernel/parallel_compiler.ex:117: anonymous fn/4 in Kernel.ParallelCompiler.spawn_compilers/1`
看到这里
需要升级phoenix_html 版本,升级之后就是一片依赖的报警
【新手上路】所以暂时未解决该问题
😭 😭 😭 😭 😭
Bug由0abb363
造成
造成了这个bug
elixir的logger目前只有内置console
需要配file log么
部署的时候 配下logrotate
I have error when compile with command mix ecto.create Repo
'cl.exe' is not recognized as an internal or external command, operable program or batch file. ERROR: compile failed while processing c:/Users/opami/Desktop/elixir-china/deps/bcrypt: rebar_abort ==> elixir_china ** (Mix) Could not compile dependency :bcrypt, "escript.exe "c:/Users/opami/.mix/rebar"" command failed. You can recompile this dependency with "mix deps.compile bcrypt", update it with "mix deps.update bcrypt" or clean it with "mix deps.clean bcrypt"
How to resolve this error? Thanks
刚才登录论坛,提示用户名不存在,随后添上用户名之后说密码错误。
最后想重新注册提示说邮箱已经占用……
请问怎么解决?
不然用户体验很差
现在如果一个connection他的方法是DELETE,那么/pages/unauthorized会返回500 Internal Service Error.
ElixirChina.PageController 需要添加一个方法,效果是即使用户的请求是DELETE,也要执行
conn
|> assign_layout(:none)
|> render "unauthorized"
这个bug现在的表现直接体现在如果你想删除别人的帖子,虽然后端不让你删(是正确的),但是返回的是500 Internal Service Error. 正确的做法是返回401错误的信息,或者直接redirect到401错误的网页。
问题是换行在 Markdown 中默认是被转成空格的, 一般中文论坛都把换行开起来.
编辑器使用了 marked 但没有配置关于换行和 gfm 的选项.
这边引用的资源没有看到出处, 应该是在后边修改就可以的:
https://github.com/jw2013/elixir-china/blob/master/web/templates/layout/application.html.eex#L18
文档:
https://github.com/chjj/marked#usage
marked.setOptions({
renderer: new marked.Renderer(),
gfm: true,
breaks: false,
});
hi.
root@hb:~/elixir-china# mix ecto.create Repo
warning: variable "deps" does not exist and is being expanded to "deps()", please use parentheses to remove the ambiguity or change the variable name
mix.exs:12
warning: variable "description" does not exist and is being expanded to "description()", please use parentheses to remove the ambiguity or change the variable name
/root/elixir-china/deps/uuid/mix.exs:8
warning: variable "package" does not exist and is being expanded to "package()", please use parentheses to remove the ambiguity or change the variable name
/root/elixir-china/deps/uuid/mix.exs:9
warning: variable "deps" does not exist and is being expanded to "deps()", please use parentheses to remove the ambiguity or change the variable name
/root/elixir-china/deps/uuid/mix.exs:10
===> Compiling bcrypt
make: Entering directory '/root/elixir-china/deps/bcrypt/c_src'
cc bcrypt_port.c bcrypt.o blowfish.o -lpthread -o ../priv/bcrypt
cc: error: bcrypt.o: No such file or directory
cc: error: blowfish.o: No such file or directory
Makefile:4: recipe for target '../priv/bcrypt' failed
make: *** [../priv/bcrypt] Error 1
make: Leaving directory '/root/elixir-china/deps/bcrypt/c_src'
===> Hook for compile failed!
* (Mix) Could not compile dependency :bcrypt, "/root/.mix/rebar3 bare compile --paths "/root/elixir-china/_build/dev/lib//ebin"" command failed. You can recompile this dependency with "mix deps.compile bcrypt", update it with "mix deps.update bcrypt" or clean it with "mix deps.clean bcrypt"
root@hb:/elixir-china#/elixir-china# mix deps.compile bcrypt
root@hb:
warning: variable "deps" does not exist and is being expanded to "deps()", please use parentheses to remove the ambiguity or change the variable name
mix.exs:12
warning: variable "description" does not exist and is being expanded to "description()", please use parentheses to remove the ambiguity or change the variable name
/root/elixir-china/deps/uuid/mix.exs:8
warning: variable "package" does not exist and is being expanded to "package()", please use parentheses to remove the ambiguity or change the variable name
/root/elixir-china/deps/uuid/mix.exs:9
warning: variable "deps" does not exist and is being expanded to "deps()", please use parentheses to remove the ambiguity or change the variable name
/root/elixir-china/deps/uuid/mix.exs:10
===> Compiling bcrypt
make: Entering directory '/root/elixir-china/deps/bcrypt/c_src'
cc bcrypt_port.c bcrypt.o blowfish.o -lpthread -o ../priv/bcrypt
cc: error: bcrypt.o: No such file or directory
cc: error: blowfish.o: No such file or directory
Makefile:4: recipe for target '../priv/bcrypt' failed
make: *** [../priv/bcrypt] Error 1
make: Leaving directory '/root/elixir-china/deps/bcrypt/c_src'
===> Hook for compile failed!
* (Mix) Could not compile dependency :bcrypt, "/root/.mix/rebar3 bare compile --paths "/root/elixir-china/_build/dev/lib//ebin"" command failed. You can recompile this dependency with "mix deps.compile bcrypt", update it with "mix deps.update bcrypt" or clean it with "mix deps.clean bcrypt"
root@hb:~/elixir-china#
新项目,为何不直接用 3 呢?
love your work!
i follow the install steps cause errors :
➜ elixir-china git:(master) mix ecto.migrate Repo
19:37:09.757 [error] GenServer #PID<0.192.0> terminating
** (stop) %Postgrex.Error{message: "tcp connect: connection refused - :econnrefused", postgres: nil}
Last message: nil
State: [password: :REDACTED, timeout: 5000, otp_app: :elixir_china, repo: ElixirChina.Repo, adapter: Ecto.Adapters.Postgres, database: "elixir_china", username: "postgres", hostname: "localhost", extensions: [{Ecto.Adapters.Postgres.DateTime, []}, {Postgrex.Extensions.JSON, [library: Poison]}], port: 5432]
** (exit) exited in: :gen_server.call(#PID<0.192.0>, {:query, #Reference<0.0.2.1982>, :infinity}, 5000)
** (EXIT) %Postgrex.Error{message: "tcp connect: connection refused - :econnrefused", postgres: nil}
(postgrex) lib/postgrex/connection.ex:97: Postgrex.Connection.query/4
(ecto) lib/ecto/adapters/postgres/connection.ex:31: Ecto.Adapters.Postgres.Connection.query/4
(ecto) lib/ecto/adapters/sql.ex:259: Ecto.Adapters.SQL.query/7
(ecto) lib/ecto/pool.ex:159: Ecto.Pool.do_run/4
(ecto) lib/ecto/adapters/sql.ex:247: Ecto.Adapters.SQL.query/6
(ecto) lib/ecto/adapters/sql.ex:225: Ecto.Adapters.SQL.query/5
(ecto) lib/ecto/adapters/sql.ex:183: Ecto.Adapters.SQL.query!/5
(ecto) lib/ecto/adapters/postgres.ex:56: anonymous fn/4 in Ecto.Adapters.Postgres.execute_ddl/3
(elixir) lib/enum.ex:1473: Enum."-reduce/3-lists^foldl/2-0-"/3
(ecto) lib/ecto/adapters/postgres.ex:56: Ecto.Adapters.Postgres.execute_ddl/3
(ecto) lib/ecto/migrator.ex:43: Ecto.Migrator.migrated_versions/2
(ecto) lib/ecto/migrator.ex:142: Ecto.Migrator.run/4
(ecto) lib/mix/tasks/ecto.migrate.ex:63: anonymous fn/4 in Mix.Tasks.Ecto.Migrate.run/2
(elixir) lib/enum.ex:604: Enum."-each/2-lists^foreach/1-0-"/2
(elixir) lib/enum.ex:604: Enum.each/2
(mix) lib/mix/cli.ex:58: Mix.CLI.run_task/2
(elixir) lib/code.ex:363: Code.require_file/2
== Compilation error on file lib/phoenix/socket.ex ==
** (ArgumentError) Access is not a protocol, cannot derive Access for Phoenix.Socket
(elixir) lib/protocol.ex:76: Protocol.assert_protocol!/2
(elixir) lib/protocol.ex:591: Protocol.derive/5
(stdlib) lists.erl:1336: :lists.foreach/2
(elixir) lib/protocol.ex:579: Protocol.__derive__/3
lib/phoenix/socket.ex:24: (module)
could not compile dependency :phoenix, "mix compile" failed. You can recompile this dependency with "mix deps.compile phoenix", update it with "mix deps.update phoenix" or clean it with "mix deps.clean phoenix"
Elixir version 1.1.1
erlang version: Erlang/OTP 17 [erts-6.3] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]
直接允许会提示没有权限创建数据库。
➜ elixir-china git:(master) sudo mix ecto.create Repo
** (Mix.Error) The database for repo Repo couldn't be created, reason given: ERROR: permission denied to create database
.
(ecto) lib/mix/tasks/ecto.create.ex:32: Mix.Tasks.Ecto.Create.run/1
(mix) lib/mix/cli.ex:55: Mix.CLI.run_task/2
(elixir) lib/code.ex:316: Code.require_file/2
➜ elixir-china git:(master) sub .
➜ elixir-china git:(master)
比如“线下活动”,“OTP”,“Erlang”,“Phoenix”,“Hex”,甚至是其他的函数式语言或者并发能力强的语言等,具体可以再想想和讨论一下。
另外感觉 “学习资料” 有点宽泛,感觉现在大家更多是当“分享”在用
发现用户名区分大小写。我觉得比较麻烦,登陆容易造成困扰,也容易冒认身份。
例子:
http://elixir-cn.com/posts/5
里的代码中<,>没有被正确的显示。
这个PR 0e00ba1 merge后,编辑的时候我们也用Lepture editor了。。。
那东西更新的值没设置对,一直提交的是老的值。。。
我希望是BSD/MIT
这些错误信息目前包括注册时(http://localhost:4000/users):
用户名空白,用户名过短,邮箱空白,邮箱过短,用户名已存在,邮箱已存在。
因为这个是Ecto层的错误信息,我们需要想办法把他中文化。
有人在重写网站吗?
现在 navbar 挺空的,而且加个简单的页面作为 Wiki,可以引导大家去找到一些资料。以及一些实际的、**特色的问题,比如**的 Hex 源、如何找到一些线下组织(比如 Meetup、微信群、Slack 等信息)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.