我rahm_test_controller.erl
在src
目录中创建了该文件,并添加了一个名为的操作hello
.
在/priv/rahm.routes
,我为主页添加了这一行:
{"/",[{controller,"test"}, {action, "hello"}]}.
Run Code Online (Sandbox Code Playgroud)
如果我启动服务器./init-dev.sh
,它可以工作,但如果我在生产模式下启动服务器./init.sh start
,它不起作用.当我打开主页时,它显示"没有收到数据".
这有什么问题?
学习Erlang的芝加哥老板似乎是一个整洁的框架和一个很好的借口.
有没有人用过它?我能在一台机器上真正获得出色的性能吗?
Chicago Boss
是一个伟大的Erlang框架.它附带很多依赖条件包括mochiweb
,yaws
,和misultin
.安装完成后,Chicago Boss可以很好地运行开发服务器.
我需要知道它附带了哪些Web服务器,默认使用它?如何在不影响芝加哥Boss项目的情况下从一个Web服务器更改为另一个Web服务器?
我是二郎和芝加哥老板的新手.我跟着芝加哥老板的API文档.我之前一直在使用Python和Django.现在在芝加哥老板我们可以在模型中添加外键.
这是我的模特.
model:anatomy.erl
-module(anatomy, [Id,
UID,
Name,
Property,
Ratio::float(),
Value::integer(),
Pieces::float(),
Status]).
-compile(export_all).
Run Code Online (Sandbox Code Playgroud)
还有另一种模式.
型号:species.erl
-module(species, [Id,
UID,
Name,
Property,
Anatomy,
Morphology
Gender]).
-compile(export_all).
Run Code Online (Sandbox Code Playgroud)
我必须Anatomy
在species
表中添加外键.
我刚刚在Chicago Boss(Erlang web framework)dir中尝试了"make"并且错误地失败了
{"init terminating in do_boot",{undef,[{make,all,[]},{init,start_it,1},{init,start_em,1}]}}
Run Code Online (Sandbox Code Playgroud)
怎么了?我该怎么办?
我的环境是Ubuntu 10.04,Erlang R13B03.
我正在使用chicagoboss
Web开发。为了测试一些测试模块,我想将当前目录更改为其他目录。我知道可以通过指定的完整路径来更改目录cd("full path")
。假设我在运行myproject项目的目录“ / home / user / workspace / myproject / myapp /”中。但是现在我想使用erlang shell检查我的当前位置。
是否有任何功能/命令erlang
来获取当前的工作目录?在python中,我正在使用os.getcwd()
。
所以按照本教程:
https://github.com/evanmiller/ChicagoBoss/wiki/An-Evening-With-Chicago-Boss
除了我不能使用"user"作为模型名称之外,一切都像魅力一样.最小用例:
-module(customer, [Id, Name, PasswordHash]).
-compile(export_all).
Run Code Online (Sandbox Code Playgroud)
这样可以正常工作.
-module(user, [Id, Name, PasswordHash]).
-compile(export_all).
Run Code Online (Sandbox Code Playgroud)
这将堆栈跟踪,然后./rebar compile
,它抛出:
ERROR: pre_compile failed while processing /Users/abe/github/awesome-name: {'EXIT',{{badmatch,{error,["code reload failed: user"]}},
[{boss_load,load_all_modules,3,
[{file,"src/boss/boss_load.erl"},{line,30}]},
{boss_load,load_all_modules_and_emit_app_file,2,
[{file,"src/boss/boss_load.erl"},{line,44}]},
{boss_rebar,compile,4,
[{file,"/Users/abe/github/ChicagoBoss/priv/rebar/boss_rebar.erl"},
{line,85}]},
{boss_plugin,pre_compile,2,
[{file,"priv/rebar/boss_plugin.erl"},{line,105}]},
{rebar_core,run_modules,4,[]},
{rebar_core,execute,5,[]},
{rebar_core,process_dir1,6,[]},
{rebar_core,process_commands,2,[]}]}}
Run Code Online (Sandbox Code Playgroud)
这发生在{db_adapter, mock}
和{db_adapter, mongo}
.
谁知道发生了什么事?是否在某处保留了用户关键字?如果它是......我在文档中找不到它