How to fix "uninitialized constant User" - ruby-on-rails

I tried to make a new Devise model "User", but I can't. My server won't load either. I keep getting the error: "uninitialized constant User".
Here's what I tried:
bundle install, bundle update, and gem pristine --all
Adding require 'devise' into my application.rb
Restarting my server, which now won't launch
Running rails g devise:install in my terminal
Here's my gem file:
source 'https://rubygems.org'
gem 'rails', '4.2.6'
gem 'pg', '~> 0.15'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'bootstrap-sass', '~> 3.3.6'
gem 'rails_12factor'
gem "figaro"
gem 'devise'
gem 'paperclip', github: 'thoughtbot/paperclip'
group :development, :test do
gem 'byebug'
gem 'sqlite3'
end
group :development do
gem 'web-console', '~> 2.0'
gem 'spring'
end
Stack trace:
WARNING: Nokogiri was built against LibXML version 2.9.4, but has dynamically loaded 2.9.2
/Users/Sam/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.6/lib/active_support/inflector/methods.rb:261:in `const_get': uninitialized constant User (NameError)
from /Users/Sam/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.6/lib/active_support/inflector/methods.rb:261:in `block in constantize'
from /Users/Sam/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.6/lib/active_support/inflector/methods.rb:259:in `each'
from /Users/Sam/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.6/lib/active_support/inflector/methods.rb:259:in `inject'
from /Users/Sam/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.6/lib/active_support/inflector/methods.rb:259:in `constantize'
from /Users/Sam/.rvm/gems/ruby-2.2.1/gems/devise-4.1.1/lib/devise.rb:289:in `get'
from /Users/Sam/.rvm/gems/ruby-2.2.1/gems/devise-4.1.1/lib/devise/mapping.rb:81:in `to'
from /Users/Sam/.rvm/gems/ruby-2.2.1/gems/devise-4.1.1/lib/devise/mapping.rb:76:in `modules'
from /Users/Sam/.rvm/gems/ruby-2.2.1/gems/devise-4.1.1/lib/devise/mapping.rb:93:in `routes'
from /Users/Sam/.rvm/gems/ruby-2.2.1/gems/devise-4.1.1/lib/devise/mapping.rb:160:in `default_used_route'
I'm not sure what is happening.

Have you generated your model?
rails generate devise User

Related

stack level too deep (SystemStackError) while deploy heroku

I'm having a stack level too deep error using Ruby 2.3.1 with Rails 4.2.6.
How should I fix this problem?
When I run below command, error showed up.
heroku run rails db:migrate
Here is the error.
Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)
Traceback (most recent call last):
8390: from /app/bin/bundle:3:in `<main>'
8389: from /app/bin/bundle:3:in `load'
8388: from /app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/exe/bundle:22:in `<top (required)>'
8387: from /app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/friendly_errors.rb:120:in `with_friendly_errors'
8386: from /app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/friendly_errors.rb:123:in `rescue in with_friendly_errors'
8385: from /app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/friendly_errors.rb:45:in `log_error'
8384: from /app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/friendly_errors.rb:95:in `request_issue_report_for'
8383: from /app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/env.rb:18:in `report'
... 8378 levels...
4: from /app/vendor/bundle/ruby/2.5.0/gems/activesupport-4.2.6/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
3: from /app/vendor/bundle/ruby/2.5.0/gems/activesupport-4.2.6/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
2: from /app/vendor/bundle/ruby/2.5.0/gems/activesupport-4.2.6/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
1: from /app/vendor/bundle/ruby/2.5.0/gems/activesupport-4.2.6/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-4.2.6/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>': stack level too deep (SystemStackError)
Here is Gemfile.rb
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.8'
# Use mysql as the database for Active Record
gem 'mysql2', '>= 0.3.13', '< 0.5', group: :development
gem 'pg', group: :production
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
end
gem 'pry-rails'
gem 'compass-rails','~> 2.0'
gem 'sprockets', '2.11.0'
gem 'devise'
gem 'omniauth'
gem 'omniauth-facebook'
gem 'omniauth-twitter'
gem 'bootstrap-sass'
gem 'dotenv-rails'
gem 'paperclip'
gem 'omniauth-instagram'
gem 'instagram'
gem 'friendly_id'
gem 'font-awesome-rails'
gem 'zeroclipboard-rails'
gem 'rails-i18n'
gem 'google-analytics-rails'
gem 'carrierwave'
gem 'acts_as_paranoid', '~> 0.6.0'
gem 'rails_12factor', group: :production
I updated rails version to 4.2.8 from 4.2.6. but still having same problem.
And even, heroku run bundle exec rake db:migrate doesn't work.
Can't understand why still have this error.
Anyone help me?
I got this error remove.
ruby version on production was 2.5.0 that is inappropriate.
I had version down 2.4.5. from 2.5.0, then it works.

rspec error michael hartl lesson 3

while executing the command
$ bundle exec rspec spec/requests/static_pages_spec.rb
i get this error
/home/sarfraz/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:229:in require': cannot load such file -- test/unit/assertions (LoadError)
from /home/sarfraz/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:229:inblock in require'
from /home/sarfraz/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:214:in load_dependency'
from /home/sarfraz/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:229:inrequire'
from /home/sarfraz/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-rails-2.13.1/lib/rspec/rails/adapters.rb:3:in <top (required)>'
from /home/sarfraz/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:229:inrequire'
from /home/sarfraz/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:229:in block in require'
from /home/sarfraz/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:214:inload_dependency'
from /home/sarfraz/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:229:in require'
from /home/sarfraz/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-rails-2.13.1/lib/rspec/rails.rb:11:in'
from /home/sarfraz/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:229:in require'
from /home/sarfraz/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:229:inblock in require'
from /home/sarfraz/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:214:in load_dependency'
from /home/sarfraz/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:229:inrequire'
from /home/sarfraz/Desktop/Rails Apps/sample_app/spec/spec_helper.rb:4:in <top (required)>'
from /home/sarfraz/Desktop/Rails Apps/sample_app/spec/requests/static_pages_spec.rb:1:inrequire'
from /home/sarfraz/Desktop/Rails Apps/sample_app/spec/requests/static_pages_spec.rb:1:in <top (required)>'
from /home/sarfraz/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:819:inload'
from /home/sarfraz/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:819:in block in load_spec_files'
from /home/sarfraz/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:819:ineach'
from /home/sarfraz/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:819:in load_spec_files'
from /home/sarfraz/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-2.13.1/lib/rspec/core/command_line.rb:22:inrun'
from /home/sarfraz/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-2.13.1/lib/rspec/core/runner.rb:80:in run'
from /home/sarfraz/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-2.13.1/lib/rspec/core/runner.rb:17:inblock in autorun'
this is my gemfile:
source 'https://rubygems.org'
Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.8'
Use sqlite3 as the database for Active Record
group :development, :test do
gem 'sqlite3'
gem 'rspec-rails', '2.13.1'
end
group :test do
gem 'selenium-webdriver', '2.35.1'
gem 'capybara', '2.1.0'
end
Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.2'
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 'turbolinks'
gem 'jbuilder', '~> 1.2'
group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', require: false
end
group :production do
gem 'pg', '0.15.1'
gem 'rails_12factor', '0.0.2'
end
Use ActiveModel has_secure_password
gem 'bcrypt', '~> 3.1.7'
Use unicorn as the app server
gem 'unicorn'
Use Capistrano for deployment
gem 'capistrano', group: :development
Use debugger
gem 'debugger', group: [:development, :test]
please help i cannot proceed totally stuck..
Thanks in advance
It seems the test/unit libraries are being loaded instead of the RSpec libraries. Review the contents of spec/spec_helper.rb and spec/rails_helper.rb, and the 'require' statements in the spec files to ensure that they match the instructions in the Hartl tutorial. Also, make sure you are using the current tutorial, and the recommended Ruby and Rails versions.

Error with sass-rails gem when trying to run rails server

I am using ruby 2.3.0, and rails 4.2.0. when I try to run rails server, I am getting error that seems to be related to sass-rails gem. I am not sure why this isn't working.
Thank You
here is the error:
roman#quotebeam:~/workspace/hello_app$ rails server
/home/roman/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:80:in rescue in block (2 levels) in require': There was an error while trying to load the gem 'sass-rails'. (Bundler::GemRequireError)
from /home/roman/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:76:inblock (2 levels) in require'
here is my gemfile
source 'https://rubygems.org'
gem 'rails', '4.2.0'
gem 'sass-rails', '5.0.1'
gem 'uglifier', '2.5.3'
gem 'coffee-rails', '4.1.0'
gem 'jquery-rails', '4.0.3'
gem 'turbolinks', '2.3.0'
gem 'jbuilder', '2.2.3'
gem 'sdoc', '0.4.0', group: :doc
group :development, :test do
gem 'sqlite3', '1.3.9'
gem 'byebug', '3.4.0'
gem 'web-console', '~> 2.0'
gem 'spring', '1.1.3'
end

Rake db actions get an EOF error in read_nonblock

I'm setting up a local copy of an inherited Rails 4 app (Ruby 2.0.0p645) with a Postgres database. The database works fine on its own, and migrations go through without problems, but rake db:seed, db:load, db:dump, and db:purge all throw the same error.
~/.rbenv/versions/2.0.0-p645/lib/ruby/2.0.0/net/protocol.rb:153:in `read_nonblock': end of file reached (EOFError)
from ~/.rbenv/versions/2.0.0-p645/lib/ruby/2.0.0/net/protocol.rb:153:in `rbuf_fill'
from ~/.rbenv/versions/2.0.0-p645/lib/ruby/2.0.0/net/protocol.rb:134:in `readuntil'
from ~/.rbenv/versions/2.0.0-p645/lib/ruby/2.0.0/net/protocol.rb:144:in `readline'
from ~/.rbenv/versions/2.0.0-p645/lib/ruby/2.0.0/net/http/response.rb:307:in `read_chunked'
from ~/.rbenv/versions/2.0.0-p645/lib/ruby/2.0.0/net/http/response.rb:276:in `block in read_body_0'
from ~/.rbenv/versions/2.0.0-p645/lib/ruby/2.0.0/net/http/response.rb:269:in `inflater'
from ~/.rbenv/versions/2.0.0-p645/lib/ruby/2.0.0/net/http/response.rb:274:in `read_body_0'
from ~/.rbenv/versions/2.0.0-p645/lib/ruby/2.0.0/net/http/response.rb:201:in `read_body'
from ~/.rbenv/versions/2.0.0-p645/lib/ruby/2.0.0/net/http/response.rb:226:in `body'
from ~/.rbenv/versions/2.0.0-p645/lib/ruby/2.0.0/net/http/response.rb:163:in `reading_body'
from ~/.rbenv/versions/2.0.0-p645/lib/ruby/2.0.0/net/http.rb:1418:in `block in transport_request'
from ~/.rbenv/versions/2.0.0-p645/lib/ruby/2.0.0/net/http.rb:1409:in `catch'
from ~/.rbenv/versions/2.0.0-p645/lib/ruby/2.0.0/net/http.rb:1409:in `transport_request'
from ~/.rbenv/versions/2.0.0-p645/lib/ruby/2.0.0/net/http.rb:1382:in `request'
from ~/.rbenv/versions/2.0.0-p645/lib/ruby/gems/2.0.0/gems/rest-client-1.6.7/lib/restclient/net_http_ext.rb:51:in `request'
from ~/.rbenv/versions/2.0.0-p645/lib/ruby/2.0.0/net/http.rb:1375:in `block in request'
from ~/.rbenv/versions/2.0.0-p645/lib/ruby/2.0.0/net/http.rb:852:in `start'
from ~/.rbenv/versions/2.0.0-p645/lib/ruby/2.0.0/net/http.rb:1373:in `request'
from ~/.rbenv/versions/2.0.0-p645/lib/ruby/gems/2.0.0/gems/rest-client-1.6.7/lib/restclient/net_http_ext.rb:51:in `request'
from ~/.rbenv/versions/2.0.0-p645/lib/ruby/gems/2.0.0/gems/httparty-0.12.0/lib/httparty/request.rb:93:in `perform'
from ~/.rbenv/versions/2.0.0-p645/lib/ruby/gems/2.0.0/gems/httparty-0.12.0/lib/httparty.rb:486:in `perform_request'
from ~/.rbenv/versions/2.0.0-p645/lib/ruby/gems/2.0.0/gems/httparty-0.12.0/lib/httparty.rb:439:in `post'
from ~/.rbenv/versions/2.0.0-p645/lib/ruby/gems/2.0.0/gems/httparty-0.12.0/lib/httparty.rb:522:in `post'
from ~/.rbenv/versions/2.0.0-p645/lib/ruby/gems/2.0.0/gems/runtimeerror_notifier-0.0.18/lib/runtimeerror_notifier/notifier.rb:46:in `make_request'
from ~/.rbenv/versions/2.0.0-p645/lib/ruby/gems/2.0.0/gems/runtimeerror_notifier-0.0.18/lib/runtimeerror_notifier/notifier.rb:39:in `notification'
from ~/.rbenv/versions/2.0.0-p645/lib/ruby/gems/2.0.0/gems/actionpack-4.0.3/lib/abstract_controller/base.rb:189:in `process_action'
from ~/.rbenv/versions/2.0.0-p645/lib/ruby/gems/2.0.0/gems/actionpack-4.0.3/lib/abstract_controller/callbacks.rb:18:in `block in process_action'
from ~/.rbenv/versions/2.0.0-p645/lib/ruby/gems/2.0.0/gems/activesupport-4.0.3/lib/active_support/callbacks.rb:373:in `_run__295926636__process_action__callbacks'
from ~/.rbenv/versions/2.0.0-p645/lib/ruby/gems/2.0.0/gems/activesupport-4.0.3/lib/active_support/callbacks.rb:80:in `run_callbacks'
from ~/.rbenv/versions/2.0.0-p645/lib/ruby/gems/2.0.0/gems/actionpack-4.0.3/lib/abstract_controller/callbacks.rb:17:in `process_action'
from ~/.rbenv/versions/2.0.0-p645/lib/ruby/gems/2.0.0/gems/actionpack-4.0.3/lib/abstract_controller/base.rb:136:in `process'
from ~/.rbenv/versions/2.0.0-p645/lib/ruby/gems/2.0.0/gems/actionpack-4.0.3/lib/abstract_controller/rendering.rb:44:in `process'
from ~/.rbenv/versions/2.0.0-p645/lib/ruby/gems/2.0.0/gems/actionmailer-4.0.3/lib/action_mailer/base.rb:503:in `process'
from ~/.rbenv/versions/2.0.0-p645/lib/ruby/gems/2.0.0/gems/actionmailer-4.0.3/lib/action_mailer/base.rb:497:in `initialize'
from ~/.rbenv/versions/2.0.0-p645/lib/ruby/gems/2.0.0/gems/actionmailer-4.0.3/lib/action_mailer/base.rb:480:in `new'
from ~/.rbenv/versions/2.0.0-p645/lib/ruby/gems/2.0.0/gems/actionmailer-4.0.3/lib/action_mailer/base.rb:480:in `method_missing'
from ~/.rbenv/versions/2.0.0-p645/lib/ruby/gems/2.0.0/gems/runtimeerror_notifier-0.0.18/lib/runtimeerror_notifier/rake_handler.rb:13:in `display_errors_with_runtimeerror'
from ~/.rbenv/versions/2.0.0-p645/lib/ruby/gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:174:in `rescue in standard_exception_handling'
from ~/.rbenv/versions/2.0.0-p645/lib/ruby/gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:165:in `standard_exception_handling'
from ~/.rbenv/versions/2.0.0-p645/lib/ruby/gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:75:in `run'
from ~/Code/dbSeer/docufyi/bin/rake:4:in `<main>'
I find this quite confusing, especially since all mentions I can find of EOF errors involving read_nonblock involve HTTP requests, and I can't find any reason why these database tasks should be involving that at all.
Any idea why these HTTP gems might be getting involved?
My entire database.yml, which seems potentially relevant:
development:
adapter: postgresql
database: docufyi_development
username: postgres
host: 127.0.0.1
password:
encoding: utf8
pool: 5
(Suggestions for common gems that use httparty or rest-client also appreciated.)
Gemfile:
source 'https://rubygems.org'
ruby '2.0.0'
gem 'rails', '4.0.3'
gem 'aasm'
gem 'activeadmin', github: 'gregbell/active_admin'
gem 'acts-as-taggable-on'
gem 'awesome_print'
gem 'carrierwave', '~> 0.9.0'
gem 'cells'
gem 'cocoon'
gem 'coffee-rails', '~> 4.0.0'
gem 'country_select'
gem 'dalli'
gem 'devise'
gem 'devise_invitable', '~> 1.3.2'
gem 'email_validator'
gem 'entypo-rails'
gem 'faker', '~> 1.2.0'
gem 'figaro', '~> 0.7.0'
gem 'fog', '~> 1.18.0'
gem 'grim', '~> 0.3.0'
gem 'haml-rails'
gem 'high_voltage', '~> 2.0.0'
gem 'icalendar', '~> 1.4.4'
gem 'jbuilder', '~> 1.2'
gem 'jquery-rails'
gem 'jquery-ui-rails'
gem 'jquery-ui-themes'
gem 'jquery-turbolinks'
gem 'memcachier'
gem 'mobile-fu'
gem 'money-rails'
gem 'newrelic_rpm'
gem 'paper_trail', '~> 3.0.2'
gem 'pg'
gem 'polar-express', :git => 'https://github.com/danielboggs/polar-express.git'
gem 'pry-rails'
gem 'pundit', :git => 'https://github.com/elabs/pundit.git'
gem 'redcarpet'
gem 'runtimeerror_notifier'
gem 'bootstrap-sass', '~> 3.3.1'
gem 'sass-rails', '~> 4.0.0'
gem 'sidekiq', '~> 2.16.1'
gem 'simple_form', '~> 3.0.0'
gem 'simple-form-datepicker'
gem 'stripe', '~> 1.9.9'
gem 'stripe_event'
gem 'turbolinks'
gem 'uglifier', '>= 1.3.0'
gem 'mimemagic'
gem 'unf'
gem 'user_impersonate2', :require => 'user_impersonate'
gem 'webshims-rails'
gem 'whenever', :require => false
# use vPim for vCard Uploader
gem 'vpim', '~> 13.11.11'
# use font-awesome icons
gem "font-awesome-rails"
group :development do
gem 'byebug'
gem 'hirb'
gem 'quiet_assets'
gem 'thin'
# uses mailcatcher
end
group :production, :staging do
gem 'rails_12factor'
end
group :test do
gem 'cucumber-rails', :git => 'git://github.com/cucumber/cucumber-rails', :require => false
gem 'database_cleaner', '~> 1.1.1'
gem 'email_spec'
gem 'factory_girl_rails', '~> 4.2.1'
gem 'json_spec'
gem 'rspec-cells'
gem 'rspec-rails', '~> 2.0'
gem 'selenium-webdriver'
gem 'shoulda-matchers', '~> 2.4.0'
gem 'spreewald'
gem 'utensils'
gem 'webrat'
end
Can you check the initializers?, apparently the problem has to do with a the RestClient gem. Are you using it by any chance?.

warning: already initialized constant Gem::VERSION when running bundle exec rake

When in my Rails app I try to run:
bundle exec rake -P RAILS_ENV=production
I get the following errors:
/Users/homm/.rvm/gems/ruby-2.1.2/gems/gem-0.0.1.alpha/lib/gem.rb:9: warning: already initialized constant Gem::VERSION
/Users/homm/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems.rb:11: warning: previous definition of VERSION was here
/Users/homm/.rvm/gems/ruby-2.1.2/gems/gem-0.0.1.alpha/lib/gem/requirement.rb:9: warning: already initialized constant Gem::Version::Requirement
/Users/homm/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/requirement.rb:269: warning: previous definition of Requirement was here
/Users/homm/.rvm/gems/ruby-2.1.2/gems/gem-0.0.1.alpha/lib/gem/platform.rb:2: warning: already initialized constant Gem::Platform::RUBY
/Users/homm/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/platform.rb:195: warning: previous definition of RUBY was here
rake aborted!
LoadError: cannot load such file -- gem/require
/Users/homm/.rvm/gems/ruby-2.1.2/gems/gem-0.0.1.alpha/lib/gem.rb:249:in `require'
/Users/homm/.rvm/gems/ruby-2.1.2/gems/gem-0.0.1.alpha/lib/gem.rb:249:in `<top (required)>'
/Users/homm/.rvm/gems/ruby-2.1.2/gems/bundler-1.7.2/lib/bundler/runtime.rb:76:in `require'
/Users/homm/.rvm/gems/ruby-2.1.2/gems/bundler-1.7.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
/Users/homm/.rvm/gems/ruby-2.1.2/gems/bundler-1.7.2/lib/bundler/runtime.rb:72:in `each'
/Users/homm/.rvm/gems/ruby-2.1.2/gems/bundler-1.7.2/lib/bundler/runtime.rb:72:in `block in require'
/Users/homm/.rvm/gems/ruby-2.1.2/gems/bundler-1.7.2/lib/bundler/runtime.rb:61:in `each'
/Users/homm/.rvm/gems/ruby-2.1.2/gems/bundler-1.7.2/lib/bundler/runtime.rb:61:in `require'
/Users/homm/.rvm/gems/ruby-2.1.2/gems/bundler-1.7.2/lib/bundler.rb:133:in `require'
/Users/homm/Projectes/testapp/config/application.rb:14:in `<top (required)>'
/Users/homm/Projectes/testapp/Rakefile:4:in `require'
/Users/homm/Projectes/testapp/Rakefile:4:in `<top (required)>'
/Users/homm/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `eval'
/Users/homm/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `<main>'
I have the following Gemfile:
source 'https://rubygems.org'
ruby '2.1.2'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.0'
# Use sqlite3 as the database for Active Record
group :test, :development do
gem 'sqlite3'
end
group :production do
gem 'gem'
gem 'rails_12factor'
end
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring', group: :development
group :development, :test do
gem 'rspec-rails', '~> 3.1.0'
gem 'guard-rspec', '~> 4.3.1'
gem 'factory_girl_rails', '~> 4.4.1'
gem 'capybara', '~> 2.4.1'
end
gem 'slim', '~> 2.0.3'
gem 'devise', '~> 3.3.0'
gem "paperclip", "~> 4.2"
# Bootstrap
gem 'libv8'
gem "therubyracer"
gem "less-rails"
gem "twitter-bootstrap-rails"
And I am not sure what is going on. I found this error when trying to push to Heroku, and then I tried to reproduce in my local machine...
In my case adding gem 'openssl' to my Gemfile fixed it (RVM, used autolibs).
Check if you don't have accidentally added this to your Gemfile and remove it:
gem 'gem'

Resources