运行Rails服务器时出现问题

时间:2017-03-08 20:26:30

标签: ruby-on-rails

我运行rails服务器时出现此错误消息。

  

无法加载此类文件--bcrypt_ext(LoadError)

请帮忙

Error message snipet

1 个答案:

答案 0 :(得分:0)

尝试使用package cli import "github.com/urfave/cli" // FlagsStruct - holds command line args type FlagsStruct struct { MyFlag string } // StartCLI - gathers command line args func StartCLI(cliFlags *FlagsStruct, args []string) error { app := cli.NewApp() app.Action = func(ctx *cli.Context) error { MyFlag := ctx.GlobalString("my-flag") // build the cli struct to send back to main cliFlags.MyFlag = MyFlag return nil } app.Authors = []cli.Author{ { Email: "my@email.com", Name: "Adam Hanna", }, } app.Flags = []cli.Flag{ cli.StringFlag{ Name: "my-flag, f", Usage: "My flag usage goes here", Value: "myDefault", }, } app.Name = "myAppName" app.Usage = "My App's Usage" app.Version = "0.0.1" return app.Run(args) } gem uninstall bcrypt卸载bcrypt。

然后重新安装gem uninstall bcrypt-ruby并将其添加到您的gemfile gem install bcrypt --platform=ruby