我跑了sudo npm install -g generator-flask,它被保存了.我能够通过跑步确认npm list-g.
然后我跑了yo flask.认为这将起作用,我得到一个错误消息:
Error flask You don't seem to have a generator with the name flask installed. You can see available generators with npm search yeoman-generator and then install them with npm install [name]. To see the 22 registered generators run yo with the `--help` option.
我通过跑步告诉我,yo --help并发现烧瓶发生器不在那里.
我试试这个,sudo npm install -g generator-angular-flask用Angular Flask重新创建问题.我假设所有发生器都会发生这种情况,这就是为什么我把它标题为Yeoman没有认识到新的npm安装.
有谁知道为什么会这样?
在Python中,有字典:
residents = {'Puffin' : 104, 'Sloth' : 105, 'Burmese Python' : 106}
Run Code Online (Sandbox Code Playgroud)
在Ruby中,有哈希:
residents = {'Puffin' => 104, 'Sloth' => 105, 'Burmese Python' => 106}
Run Code Online (Sandbox Code Playgroud)
唯一的区别是:对比=>语法.(注意,如果示例使用变量而不是字符串,那么就没有语法差异.)
在Python中,您可以通过键调用字典的值:
residents['Puffin']
# => 104
Run Code Online (Sandbox Code Playgroud)
在Ruby中,您还可以通过键获取Hash的值:
residents['Puffin']
# => 104
Run Code Online (Sandbox Code Playgroud)
它们看起来是一样的.
Ruby中的Hash和Python中的字典有什么区别?
spree的这个安全更新刚刚发布,但是在运行了一些Cucumber测试之后,我遇到了这个反复出现的问题:
undefined method `assume_from_symbol' for Money:Class (ActionView::Template::Error)
Run Code Online (Sandbox Code Playgroud)
我搜索了关于GH的项目回购,我们不使用该方法.搜索了Money回购,也没有发现.搜索Spree并发现了这一点.该方法在我的开发环境中似乎未定义.
我不知道它的Spree或我正在处理的项目.有谁知道如何解决这一问题?
更新:当我跑步时,bundle exec zeus cucumber我没有得到这些错误......
这是我的文件结构在Play中的样子:
- public
- bower_components
- images
- stylesheets
Run Code Online (Sandbox Code Playgroud)
这是我的<head>:
<head>
<title>@title</title>
<link rel="shortcut icon" href='@routes.Assets.at("images/favicon.png")'>
<link rel="stylesheet" media="screen" href='@routes.Assets.at("bower_components/bootstrap/dist/css/bootstrap.min.css")'>
<link rel="stylesheet" media="screen" href='@routes.Assets.at("stylesheets/main.css")'>
<script src='@routes.Assets.at("bower_components/jquery/dist/jquery.min.js")'></script>
<script src='@routes.Assets.at("bower_components/bootstrap/dist/js/bootstrap.min.js")'></script>
</head>
Run Code Online (Sandbox Code Playgroud)
路线:
GET / controllers.Application.index
GET /public controllers.Application.public
GET /assets/*file controllers.Assets.at(path="/public", file)
Run Code Online (Sandbox Code Playgroud)
它适用于开发我有200多岁.当我部署到Heroku时,除了样式表和图像目录之外,我为所有的bower组件获得404s.
我假设可能是因为Play无法识别bower组件目录.有谁知道如何为资产添加一个新的目录来构建?
有时你制作一个特定于项目的宝石.这有助于抽象并从主Rails应用程序中拉出一些"责任",并进入更加模块化的地方.
宝石将位于您的应用程序上:
gem 'example_gem', path: './example_gem'
Run Code Online (Sandbox Code Playgroud)
你捆绑,一切都好.现在,您git init将宝石存储在github上的自己的仓库中.您尝试这样做是为了保持开发人员友好:
group :development, :test do
gem 'example_gem', path: './example_gem'
end
group :production do
gem 'example_gem', github: 'company/example_gem'
end
Run Code Online (Sandbox Code Playgroud)
为了增加工作流程,bundle你可以背对自己,但是在跑步之后你得到:
Your Gemfile lists the gem example_gem (>= 0) more than once.
You should probably keep only one of them.
While it's not a problem now, it could cause errors if you change the version of just one of them later.
You cannot specify the same gem twice coming from different …Run Code Online (Sandbox Code Playgroud) 马上就是这个问题:
$ dokku mysql:create app
mkdir: cannot create directory ‘/home/git’: Permission denied
Run Code Online (Sandbox Code Playgroud)
愚蠢的创立......这就是我所做的:
我去了Digital Ocean并得到了一个Dokku服务器.从那里我通过简单地转到IP并按下蓝色按钮来设置它.
然后我按照本指南,除了我与dokku mysql插件的偏差.
如果您需要更多信息,请与我们联系.我会很乐意根据评论更新我的问题.
关键问题:如果我遇到上述错误,如何设置MySQL数据库?
我在开发环境中,我想通过我的控制台发送测试电子邮件.我让控制台运行良好,但它没有发送.
我去Spree的邮件方法设置,这是我得到的:

我已经仔细检查了密码.我用谷歌搜索了它.我无法弄清楚如何使这个东西工作.
关键问题:如何从开发环境中获取Spree中的电子邮件?
我尝试的事情:狂欢邮件方法不起作用?
我想我已经database.yml不正确地完成了这个文件.该文件如下:
default: &default
adapter: mysql2
encoding: utf8
pool: 5
username: root
password:
host: localhost
development:
<<: *default
database: blog_development
test:
<<: *default
database: blog_test
production:
<<: *default
database: ENV['CLEARDB_DATABASE_URL']
username: ENV['CLEARDB_DATABASE_USERNAME']
password: ENV['CLEARDB_DATABASE_PASSWORDs']
Run Code Online (Sandbox Code Playgroud)
当我跑步时,heroku run rake db:migrate我得到:
Running `rake db:migrate` attached to terminal... up, run.8056
rake aborted!
Mysql2::Error: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Run Code Online (Sandbox Code Playgroud)
我安装了带有mysql2的ClearDB.