我该怎么办?这是错误
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:827:in `report_activate_error': Could not find RubyGem rails (>= 0) (Gem::LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:261:in `activate'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:68:in `gem'
from /usr/bin/rails:18
答案 0 :(得分:1)
您正在运行Mac OS。苹果公司将Ruby与Mac OS一起发布,但苹果自己也在使用它。我们可以捎带它,但修改它可能会导致问题,因此我们建议使用RVM或rbenv在沙箱中安装一个或多个Ruby版本,这样我们就可以随意更新,添加,删除gem,而不会影响Apple' s红宝石。
我使用它们,rbenv在我的个人机器和工作笔记本电脑上。
您也可以使用Homebrew来安装Ruby。安装单个版本时很不错,但几乎没有提供用于管理多个版本的功能/控件。因此,我不推荐或使用它来安装或管理Ruby。
您也可以从源代码安装。除非你知道自己正在做什么,否则我不建议你这样做。我会对此说些什么。
您所使用的操作系统版本已过时,Apple不再支持该版本。您可以升级到较新的Ruby,但您还需要安装Xcode安装及其相关的命令行工具。虽然RVM可能会发现要安装的预构建的Ruby,但是任何具有本机扩展的gem都需要编译,需要Xcode,并且找到支持旧操作系统的Xcode可能很困难。
答案 1 :(得分:0)
您需要更新版本的ruby才能安装rails:
System.Web.Compilation.ParseException
Expecting </asp:TextBox> System.Web.UI.WebControls.TextBoxControlBuilder
Description: Error parsing a resource required to service this request. Review your source file and modify it to fix this error.
Details: Expecting </asp:TextBox> System.Web.UI.WebControls.TextBoxControlBuilder
Error origin: Parser
Error source file: /Users/administrator/Documents/Code/Xamarin/aspnet/aspnet/Default.aspx
Exception stack trace:
at System.Web.Compilation.AspGenerator.Parse (System.IO.TextReader reader, System.String filename, Boolean doInitParser) in /private/tmp/source-mono-mac-4.2.0-branch/bockbuild-mono-4.2.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.2.1/mcs/class/System.Web/System.Web.Compilation/AspGenerator.cs:line 627
at System.Web.Compilation.GenericBuildProvider`1[TParser].Parse () in /private/tmp/source-mono-mac-4.2.0-branch/bockbuild-mono-4.2.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.2.1/mcs/class/System.Web/System.Web.Compilation/GenericBuildProvider.cs:line 87
at System.Web.Compilation.GenericBuildProvider`1[TParser].GenerateCode () in /private/tmp/source-mono-mac-4.2.0-branch/bockbuild-mono-4.2.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.2.1/mcs/class/System.Web/System.Web.Compilation/GenericBuildProvider.cs:line 102
at System.Web.Compilation.GenericBuildProvider`1[TParser].GenerateCode (System.Web.Compilation.AssemblyBuilder assemblyBuilder) in /private/tmp/source-mono-mac-4.2.0-branch/bockbuild-mono-4.2.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.2.1/mcs/class/System.Web/System.Web.Compilation/GenericBuildProvider.cs:line 121
at System.Web.Compilation.BuildManager.GenerateAssembly (System.Web.Compilation.AssemblyBuilder abuilder, System.Web.Compilation.BuildProviderGroup group, System.Web.VirtualPath vp, Boolean debug) in /private/tmp/source-mono-mac-4.2.0-branch/bockbuild-mono-4.2.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.2.1/mcs/class/System.Web/System.Web.Compilation/BuildManager.cs:line 778
Error source context:
Error lines: 11, 11
9: <asp:Button id="button1" runat="server" Text="Click me!" OnClick="button1Clicked" />
10: <asp:TextBox id="usernameTXT" runat="server" CssClass="control">foobar</asp:TextBox>
11: <asp:TextBox id="userneTXT" runat="server" CssClass="control">foobar</asp:TextBoxz>
12: </form>
13: </body>
brew install ruby