我到处都看了,似乎找不到任何东西。我只是添加了宝石' bcrypt'在创建rails项目时使用我的GemFile。之后我运行了bundle install并重新启动了服务器。当我运行rails server命令时,出现以下错误:
bin / rails:6:警告:已初始化常量APP_PATH / home / student / depot / bin / rails:6:警告:APP_PATH的先前定义在这里
这是完整的错误消息: / home / student / depot / bin / rails:6:警告:APP_PATH的先前定义在这里 用法:rails COMMAND [ARGS]
最常见的rails命令是: 生成生成新代码(捷径别名:" g") console启动Rails控制台(快捷方式:" c") server启动Rails服务器(快捷方式别名:" s") dbconsole为config / database.yml中指定的数据库启动控制台 (捷径别名:" db") new创建一个新的Rails应用程序。 " rails new my_app"创造一个 名为MyApp的新应用程序在" ./ my_app"
中除此之外,还有: application生成Rails应用程序代码 销毁撤消用"生成"生成的代码(捷径别名:" d") plugin new生成用于开发Rails插件的框架 runner在应用程序环境中运行一段代码(简短别名:" r")
所有命令都可以使用-h(或--help)运行以获取更多信息。 这是我的GemFile: 来源' https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.8'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.3'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
gem 'jquery-ui-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease.
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# Spring speeds up development by keeping your application running in the background.
gem 'spring', group: :development
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
#gem 'bcrypt-ruby', ' ~> 3.0.0'
gem 'bcrypt'
# Use unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
# Use debugger
# gem 'debugger', group: [:development, :test]
我尝试运行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)