标签: meteor

流星:意外的mongo退出代码100

我刚装了流星版本0.5.9(45fef52095)到我的CentOS版本6.3(决赛)服务器(Linux版本的2.6.32-279.19.1.el6.i686(mockbuild@c6b8.bsys.dev.centos.org)(GCC版本4.4.6 20120305(红帽4.4.6-4)(GCC))#1 SMP Wed Dec 19 04:30:58 UTC 2012)

我有一个samba共享到一个在Sache用户下挂载为/ mnt/apshared的Windows SBS服务器.我在这个名为'webmeteor'的内部创建了一个目录.我在'webmeteor'目录中创建了一个名为'myapp'的应用程序,所以我的目录是这样的:/ mnt/apshared/webmeteor/myapp.

我以root身份登录.当我尝试使用该meteor命令运行应用程序时,我收到以下错误消息:

Unexpected mongo exit code 100. Restarting.
Unexpected mongo exit code 100. Restarting.
Unexpected mongo exit code 100. Restarting.
Can't start mongod

MongoDB had an unspecified uncaught exception.
Check to make sure that MongoDB is able to write to its database directory.
Run Code Online (Sandbox Code Playgroud)

我的第一个调用点是这个StackOverflow问题:创建一个新的meteor.js文件并获得错误100,MongoDB无法写入 - 但是,遵循这些建议(sudo'ing meteor命令,并检查磁盘空间我有70GB免费)没有工作.我很确定这些问题与许可相关.

我试图chown递归root:root(因为我以root用户身份登录),并且chmod还递归到777,但无济于事.

我问你,我接下来应该尝试一下,让我的Meteor应用程序启动?

提前致谢.

permissions samba centos mongodb meteor

55
推荐指数
7
解决办法
4万
查看次数

当Meteor正在运行时,如何从其他客户端访问Meteor的MongoDB?

我想从Python客户端访问Meteor的MongoDB,而Meteor正在运行.

因为Meteor的数据库被锁定,我无法启动mongod.

如何从其他客户端访问数据库?

python mongodb meteor

54
推荐指数
3
解决办法
3万
查看次数

meteor:如何备份我的mongo数据库

如何备份meteor mongo数据库?

如果我跑:

meteor mongo
Run Code Online (Sandbox Code Playgroud)

mongodump命令在meteor mongoshell中不起作用

import backup dump mongodb meteor

54
推荐指数
2
解决办法
2万
查看次数

在Windows上开发流星支持

Meteor是否支持在Windows上开发?我没有在文档中看到任何下载或提及Windows.

"快速入门"假设您使用的是*Nix OS.

node.js meteor

53
推荐指数
4
解决办法
2万
查看次数

Meteor应用程序如何脱机工作?

这在以下情况下很有用

  • 服务器已关闭,客户端无法连接进行实时同步
  • 没有互联网连接
  • 用户不想上网但想要使用应用程序;

offline meteor

52
推荐指数
2
解决办法
2万
查看次数

如何取消部署流星应用程序?

我已经部署了一个应用程序: meteor deploy a-meteor-app.meteor.com.

有没有办法让我从meteor.com取消部署?

meteor

52
推荐指数
2
解决办法
1万
查看次数

Meteor - collection.find()始终返回所有字段

进入这个(稍微讨厌的问题)我正在尝试查找集合中的所有记录而不显示(或显示)特定字段(分数).这只是一个例子而不反映我的实际代码,但问题总是可以重现的.我排除的字段非常大,我只是想生成一个可用记录菜单.

像这样的命令

    players.find({},{score:1})
    players.find({},{score:0})
Run Code Online (Sandbox Code Playgroud)

始终返回每个字段,而不是触发mongodb中的exclude/include.我什么都不担心,因为模板可能会控制哪些数据呈现给html?无论如何,仍然感觉数据被传输到客户端; 并显示在控制台中.

mongodb node.js meteor

52
推荐指数
2
解决办法
4万
查看次数

如何在带有流星的车把助手中使用多个参数?

我正在尝试使用Meteor创建自定义帮助程序.关于这里的文档:https: //github.com/meteor/meteor/wiki/Handlebars

我试图按如下方式定义我的助手:

Template.myTemplate.testHelper = function(foo, bar, options) {
    console.log(foo);
    console.log(bar);
}
Run Code Online (Sandbox Code Playgroud)

我的模板看起来像:

<template name="myTemplate">
    {{#testHelper "value1" "value2"}}
    {{/testHelper}}
</template>
Run Code Online (Sandbox Code Playgroud)

看看我的控制台输出,我希望看到2行输出:

value1
value2
Run Code Online (Sandbox Code Playgroud)

但是我的控制台看起来像:

value1
function (data) {
    // don't create spurious annotations when data is same
    // as before (or when transitioning between e.g. `window` and
    // `undefined`)
    if ((data || Handlebars._defaultThis) ===
        (old_data || Handlebars._defaultThis))
      return fn(data);
    else
      return Spark.setDataContext(data, fn(data));
  } 
Run Code Online (Sandbox Code Playgroud)

请注意,我对流星和车把都是全新的.我想使用下划线会更开心,但是流星的文档几乎完全瞥了一眼下划线.我在定义辅助函数时做错了吗?它似乎没有看到第二个参数"bar",而是将其解释为选项.(注意:如果我是console.log(options),则返回'undefined').

流星版本0.4.0(8f4045c1b9)

javascript handlebars.js meteor meteor-helper

51
推荐指数
1
解决办法
4万
查看次数

Meteor:在服务器上正确使用Meteor.wrapAsync

背景

我正在尝试将条带付款整合到我的网站中.我需要使用私有条带密钥创建条带用户.我将此密钥存储在我的服务器上,并调用服务器方法来创建用户.也许有另一种方法可以实现这一目标?这是条纹api(为方便起见,下面复制):https: //stripe.com/docs/api/node#create_customer

//stripe api call
var Stripe = StripeAPI('my_secret_key');

Stripe.customers.create({
  description: 'Customer for test@example.com',
  card: "foobar" // obtained with Stripe.js
}, function(err, customer) {
  // asynchronously called
});
Run Code Online (Sandbox Code Playgroud)

我的尝试和结果

我一直在使用不同服务器代码的相同客户端代码.所有尝试都会在客户端的console.log(...)上立即给出undefined,但在服务器console.log(...)上给出正确的响应:

//client
Meteor.call('stripeCreateUser', options, function(err, result) {
  console.log(err, result);
});

//server attempt 1
var Stripe = StripeAPI('my_secret_key');

Meteor.methods({
    stripeCreateUser: function(options) {  
        return Meteor.wrapAsync(Stripe.customers.create({
            description: 'Woot! A new customer!',
            card: options.ccToken,
            plan: options.pricingPlan
        }, function (err, res) {
            console.log(res, err);
            return (res || err);
        }));
    }
});

//server attempt …
Run Code Online (Sandbox Code Playgroud)

javascript stripe-payments meteor

50
推荐指数
3
解决办法
3万
查看次数

Meteor,如何从另一个助手访问助手?

我有一个好帮手

Template.user_profile.helpers({
  user:function() {
     return Meteor.users.find({'profile.front_name':Session.get('slug')}).fetch()[0];
  }
});
Run Code Online (Sandbox Code Playgroud)

我想在集合中添加一个帮助程序,它可以访问user帮助程序并将其_id与当前用户进行比较_id,以判断用户是否正在访问自己的配置文件.我正在使用一些非常难看的东西:

Template.user_profile._tmpl_data.helpers.user()
Run Code Online (Sandbox Code Playgroud)

最终代码:

Template.user_profile.helpers({
  user:function() {
     return Meteor.users.find({'profile.front_name':Session.get('userId')}).fetch()[0];
  },
  isCurrentUser: function() {
    return Template.user_profile._tmpl_data.helpers.user()._id === Meteor.userId();
  }
});
Run Code Online (Sandbox Code Playgroud)

有没有更好的方法来访问另一个帮手?

javascript handlebars.js meteor

49
推荐指数
3
解决办法
1万
查看次数