0

I have looked all over the place and cannot seem to find anything. I just add the gem 'bcrypt' to my GemFile while creating a rails project. After that I ran bundle install and restarted the server. When I ran the rails server command I get the following error:

bin/rails:6: warning: already initialized constant APP_PATH /home/student/depot/bin/rails:6: warning: previous definition of APP_PATH was here

This is the full error message: /home/student/depot/bin/rails:6: warning: previous definition of APP_PATH was here Usage: rails COMMAND [ARGS]

The most common rails commands are: generate Generate new code (short-cut alias: "g") console Start the Rails console (short-cut alias: "c") server Start the Rails server (short-cut alias: "s") dbconsole Start a console for the database specified in config/database.yml (short-cut alias: "db") new Create a new Rails application. "rails new my_app" creates a new application called MyApp in "./my_app"

In addition to those, there are: application Generate the Rails application code destroy Undo code generated with "generate" (short-cut alias: "d") plugin new Generates skeleton for developing a Rails plugin runner Run a piece of code in the application environment (short-cut alias: "r")

All commands can be run with -h (or --help) for more information. Here is my GemFile: source '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]

I tried running rake:rails update:bin and here's what happened:

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)
user2958278
  • 33
  • 1
  • 1
  • 6

0 Answers0