Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby-on-rails-4/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/neo4j/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 4 安装gem bcrypt后运行rails服务器时已初始化常量app_path_Ruby On Rails 4 - Fatal编程技术网

Ruby on rails 4 安装gem bcrypt后运行rails服务器时已初始化常量app_path

Ruby on rails 4 安装gem bcrypt后运行rails服务器时已初始化常量app_path,ruby-on-rails-4,Ruby On Rails 4,我找遍了整个地方,似乎什么也没找到。我只是在创建rails项目时将gem'bcrypt'添加到我的GemFile中。之后,我运行bundle安装并重新启动服务器。运行rails服务器命令时,出现以下错误: bin/rails:6:警告:已初始化常量应用程序路径 /home/student/depot/bin/rails:6:警告:此处是应用程序路径的先前定义 这是完整的错误消息: /home/student/depot/bin/rails:6:警告:此处是应用程序路径的先前定义 用法:rails

我找遍了整个地方,似乎什么也没找到。我只是在创建rails项目时将gem'bcrypt'添加到我的GemFile中。之后,我运行bundle安装并重新启动服务器。运行rails服务器命令时,出现以下错误:

bin/rails:6:警告:已初始化常量应用程序路径 /home/student/depot/bin/rails:6:警告:此处是应用程序路径的先前定义

这是完整的错误消息: /home/student/depot/bin/rails:6:警告:此处是应用程序路径的先前定义 用法:rails命令[ARGS]

最常见的rails命令有: 生成新代码快捷别名:g 控制台启动Rails控制台快捷方式别名:c 服务器启动Rails服务器快捷方式别名:s dbconsole为config/database.yml中指定的数据库启动控制台 快捷别名:db 新建创建一个新的Rails应用程序。rails新my_应用程序创建一个 新应用程序名为MyApp in./my_应用程序

除此之外,还有: 应用程序生成Rails应用程序代码 销毁使用生成快捷别名d生成的撤消代码 pluginnew生成用于开发Rails插件的框架 runner在应用程序环境中运行一段代码快捷别名:r

有关详细信息,可以使用-h或-help运行所有命令。 这是我的档案: 来源

我试着运行rake:rails更新:bin,结果如下:

LoadError: /home/student/.rvm/gems/ruby-2.1.5/extensions/x86-linux/2.1.0/bcrypt-3.1.10/bcrypt_ext.so: file too short - /home/student/.rvm/gems/ruby-2.1.5/extensions/x86-linux/2.1.0/bcrypt-3.1.10/bcrypt_ext.so
/home/student/.rvm/gems/ruby-2.1.5/gems/bcrypt-3.1.10/lib/bcrypt.rb:16:in `require'
/home/student/.rvm/gems/ruby-2.1.5/gems/bcrypt-3.1.10/lib/bcrypt.rb:16:in `rescue in <top (required)>'
/home/student/.rvm/gems/ruby-2.1.5/gems/bcrypt-3.1.10/lib/bcrypt.rb:12:in `<top (required)>'
/home/student/.rvm/gems/ruby-2.1.5@global/gems/bundler-1.7.7/lib/bundler/runtime.rb:76:in `require'
/home/student/.rvm/gems/ruby-2.1.5@global/gems/bundler-1.7.7/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
/home/student/.rvm/gems/ruby-2.1.5@global/gems/bundler-1.7.7/lib/bundler/runtime.rb:72:in `each'
/home/student/.rvm/gems/ruby-2.1.5@global/gems/bundler-1.7.7/lib/bundler/runtime.rb:72:in `block in require'
/home/student/.rvm/gems/ruby-2.1.5@global/gems/bundler-1.7.7/lib/bundler/runtime.rb:61:in `each'
/home/student/.rvm/gems/ruby-2.1.5@global/gems/bundler-1.7.7/lib/bundler/runtime.rb:61:in `require'
/home/student/.rvm/gems/ruby-2.1.5@global/gems/bundler-1.7.7/lib/bundler.rb:133:in `require'
/home/student/depot/config/application.rb:7:in `<top (required)>'
/home/student/depot/Rakefile:4:in `<top (required)>'
LoadError: cannot load such file -- 2.1/bcrypt_ext
/home/student/.rvm/gems/ruby-2.1.5/gems/bcrypt-3.1.10/lib/bcrypt.rb:14:in `require'
/home/student/.rvm/gems/ruby-2.1.5/gems/bcrypt-3.1.10/lib/bcrypt.rb:14:in `<top (required)>'
/home/student/.rvm/gems/ruby-2.1.5@global/gems/bundler-1.7.7/lib/bundler/runtime.rb:76:in `require'
/home/student/.rvm/gems/ruby-2.1.5@global/gems/bundler-1.7.7/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
/home/student/.rvm/gems/ruby-2.1.5@global/gems/bundler-1.7.7/lib/bundler/runtime.rb:72:in `each'
/home/student/.rvm/gems/ruby-2.1.5@global/gems/bundler-1.7.7/lib/bundler/runtime.rb:72:in `block in require'
/home/student/.rvm/gems/ruby-2.1.5@global/gems/bundler-1.7.7/lib/bundler/runtime.rb:61:in `each'
/home/student/.rvm/gems/ruby-2.1.5@global/gems/bundler-1.7.7/lib/bundler/runtime.rb:61:in `require'
/home/student/.rvm/gems/ruby-2.1.5@global/gems/bundler-1.7.7/lib/bundler.rb:133:in `require'
/home/student/depot/config/application.rb:7:in `<top (required)>'
/home/student/depot/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)

这不是一个错误,而是一个警告。我已经查看了该链接并尝试使用rake rails:update bin,我只是得到了一系列错误。当我运行rake rails:update bin时,出现了很多错误。请查看更新的描述现在这看起来像是
LoadError: /home/student/.rvm/gems/ruby-2.1.5/extensions/x86-linux/2.1.0/bcrypt-3.1.10/bcrypt_ext.so: file too short - /home/student/.rvm/gems/ruby-2.1.5/extensions/x86-linux/2.1.0/bcrypt-3.1.10/bcrypt_ext.so
/home/student/.rvm/gems/ruby-2.1.5/gems/bcrypt-3.1.10/lib/bcrypt.rb:16:in `require'
/home/student/.rvm/gems/ruby-2.1.5/gems/bcrypt-3.1.10/lib/bcrypt.rb:16:in `rescue in <top (required)>'
/home/student/.rvm/gems/ruby-2.1.5/gems/bcrypt-3.1.10/lib/bcrypt.rb:12:in `<top (required)>'
/home/student/.rvm/gems/ruby-2.1.5@global/gems/bundler-1.7.7/lib/bundler/runtime.rb:76:in `require'
/home/student/.rvm/gems/ruby-2.1.5@global/gems/bundler-1.7.7/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
/home/student/.rvm/gems/ruby-2.1.5@global/gems/bundler-1.7.7/lib/bundler/runtime.rb:72:in `each'
/home/student/.rvm/gems/ruby-2.1.5@global/gems/bundler-1.7.7/lib/bundler/runtime.rb:72:in `block in require'
/home/student/.rvm/gems/ruby-2.1.5@global/gems/bundler-1.7.7/lib/bundler/runtime.rb:61:in `each'
/home/student/.rvm/gems/ruby-2.1.5@global/gems/bundler-1.7.7/lib/bundler/runtime.rb:61:in `require'
/home/student/.rvm/gems/ruby-2.1.5@global/gems/bundler-1.7.7/lib/bundler.rb:133:in `require'
/home/student/depot/config/application.rb:7:in `<top (required)>'
/home/student/depot/Rakefile:4:in `<top (required)>'
LoadError: cannot load such file -- 2.1/bcrypt_ext
/home/student/.rvm/gems/ruby-2.1.5/gems/bcrypt-3.1.10/lib/bcrypt.rb:14:in `require'
/home/student/.rvm/gems/ruby-2.1.5/gems/bcrypt-3.1.10/lib/bcrypt.rb:14:in `<top (required)>'
/home/student/.rvm/gems/ruby-2.1.5@global/gems/bundler-1.7.7/lib/bundler/runtime.rb:76:in `require'
/home/student/.rvm/gems/ruby-2.1.5@global/gems/bundler-1.7.7/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
/home/student/.rvm/gems/ruby-2.1.5@global/gems/bundler-1.7.7/lib/bundler/runtime.rb:72:in `each'
/home/student/.rvm/gems/ruby-2.1.5@global/gems/bundler-1.7.7/lib/bundler/runtime.rb:72:in `block in require'
/home/student/.rvm/gems/ruby-2.1.5@global/gems/bundler-1.7.7/lib/bundler/runtime.rb:61:in `each'
/home/student/.rvm/gems/ruby-2.1.5@global/gems/bundler-1.7.7/lib/bundler/runtime.rb:61:in `require'
/home/student/.rvm/gems/ruby-2.1.5@global/gems/bundler-1.7.7/lib/bundler.rb:133:in `require'
/home/student/depot/config/application.rb:7:in `<top (required)>'
/home/student/depot/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)