<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>dxxeng (D__Eng)</title>
    <link>https://ruby-china.org/dxxeng</link>
    <description></description>
    <language>en-us</language>
    <item>
      <title>关于 console 查询 mongo 的问题</title>
      <description>&lt;p&gt;这几天在折腾 mongo。按照&lt;a href="https://gorails.com/blog/rails-4-0-with-mongodb-and-mongoid" rel="nofollow" target="_blank" title=""&gt;gorails 的教程&lt;/a&gt;设置好了基本配置。然后 generate 了一个简单的 scaffold。但是我发现一个问题。以前用 SQL 的时候，非常喜欢用 rails console，因为直接用数据库客户端连接上去用 SQL 语言查询非常麻烦。不及 ORM 好用。所以换到了 mongo，还是习惯用 rc 进入控制台，想看看数据库的情况。&lt;/p&gt;

&lt;p&gt;但是总是碰到这个错误：&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Mongoid::Errors::NoSessionConfig:
Problem:
  No configuration could be found for a session named 'default'.
Summary:
  When attempting to create the new session, Mongoid could not find a session configuration for the name: 'default'. This is necessary in order to know the host, port, and options needed to connect.
Resolution:
  Double check your mongoid.yml to make sure under the sessions key that a configuration exists for 'default'. If you have set the configuration programatically, ensure that 'default' exists in the configuration hash.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;,
我的 mongo.yml 文件是默认生成的一点没改：&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;development:
  sessions:
    default:
      database: myapp_development
      hosts:
        - localhost:27017
      options:
  options:

test:
  sessions:
    default:
      database: myapp_test
      hosts:
        - localhost:27017
      options:
        read: primary
        max_retries: 1
        retry_interval: 0

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;google 一下找到了一个解决办法，就是使用&lt;code&gt;rails c production&lt;/code&gt;，进入以后，错误确实是不见了，也可以使用正常的查询。但是我想知道为什么要这样做？以及是否有别的解决办法？（其实主要是好奇^_^，mongo 的 shell 也很好用，对开发倒是没影响的）&lt;/p&gt;</description>
      <author>dxxeng</author>
      <pubDate>Thu, 17 Jul 2014 10:32:42 +0800</pubDate>
      <link>https://ruby-china.org/topics/20532</link>
      <guid>https://ruby-china.org/topics/20532</guid>
    </item>
    <item>
      <title>想知道有哪些合适 (最好免费) 的平台可以用来部署小规模应用?</title>
      <description>&lt;p&gt;学习 ruby 和 rails 好久了。但是感觉过了开始那段学习时间以后整个就停滞下来了。&lt;/p&gt;

&lt;p&gt;rails 把官网的 tutorial 都做了一遍，然后不知道要做点什么。&lt;/p&gt;

&lt;p&gt;我想应该很多人尤其是像我这样的学生都有这样的困惑，就是没有什么项目可以练手。生硬的看 API 手册感觉很累，而且&lt;strong&gt;没有趣&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;我坚信真正的做项目才能磨练一个人的水平。&lt;/p&gt;

&lt;p&gt;所以我现在想做点实用的网站来，但是找不到合适的平台部署。&lt;/p&gt;

&lt;p&gt;不知道各位有没有什么好的建议？适合小应用的平台，免费最好，收费的也无妨。国内访问速度要快.零花钱拿来部署网站我觉得很开心.n_n&lt;/p&gt;</description>
      <author>dxxeng</author>
      <pubDate>Sat, 19 Apr 2014 23:31:50 +0800</pubDate>
      <link>https://ruby-china.org/topics/18719</link>
      <guid>https://ruby-china.org/topics/18719</guid>
    </item>
  </channel>
</rss>
