我在Windows 8上安装了带有Rails的Ruby 2.0.0,并使用bundle install安装了一组gem。似乎一切都很好,但是当我试图运行“rake generate_secret_token”命令时,头痛就开始了。我得到的第一个错误是:
<asp:Login ID="myLogin" runat="server" OnLoginError="myLogin_LoginError">
<LayoutTemplate>
<div class="append-icon">
<asp:TextBox ID="UserName" runat="server" CssClass="form-control form-white username" placeholder="Username"></asp:TextBox>
<i class="icon-user"></i>
</div>
<div class="append-icon m-b-20">
<asp:TextBox ID="Password" runat="server" TextMode="Password" CssClass="form-control form-white password" placeholder="Password" Width="100%"></asp:TextBox>
<i class="icon-lock"></i>
</div>
<asp:LinkButton ID="LinkButton1" runat="server" CommandName="Login" CssClass="btn btn-lg btn-dark btn-rounded" Text="Sign in" ValidationGroup="login">
<i class="fa fa-angle-right"></i> Login
</asp:LinkButton>
</LayoutTemplate>
</asp:Login>
protected void myLogin_LoginError(object sender, EventArgs e)
{
TextBox tb = (TextBox)myLogin.FindControl("UserName");
tb.Attributes.Add("style", "form-control form-white username form-error");
}
我安装了mysql2 0.3.18版本,但显然rake需要降级才能运行。好的..我卸载了mysql2 gem并使用Could not find mysql2-0.3.11-x86-mingw32 in any of the sources
安装了所请求的版本。当我再次尝试生成秘密令牌时,我得到了这个:
gem install mysql2 -v=0.3.11
所以我似乎也不得不降级rake,但可以使用“bundle exec”管理问题。好的,所以我尝试使用rake aborted!
Gem::LoadError: You have already activated rake 10.4.2, but your Gemfile require
s rake 0.9.6. Prepending bundle exec to your command may solve this.
C:/Sites/redmine-3.0.4/config/boot.rb:4:in '<top (required)>'
C:/Sites/redmine-3.0.4/config/application.rb:1:in '<top (required)>'
C:/Sites/redmine-3.0.4/Rakefile:5:in '<top (required)>'
(See full trace by running task with --trace)
再次运行。然后我明白了:
bundle exec rake generate_secret_token
我验证了这些文件 - “application.rb”和“Rakefile”,它们就在那里。现在我不知道该怎么做了。有没有人知道会发生什么?
* Gemfile显示以下内容:
DL is deprecated, please use Fiddle
rake aborted!
cannot load such file -- mysql2/2.0/mysql2
C:/Sites/redmine-3.0.4/config/application.rb:5:in '<top (required)>'
C:/Sites/redmine-3.0.4/Rakefile:5:in 'require'
C:/Sites/redmine-3.0.4/Rakefile:5:in '<top (required)>'
(See full trace by running task with --trace)