Reputation: 994
I had a working application when I tried to update from rails 5.0 to 5.1. (I've been updating from 4.2 to 5.0)
It doesn't work it anymore, running commands like:
rails server
yields an error. I don't know how to fix this, and I coudn't find any information, it's weird because it points to the faker's code, not to mine.
This is the console output
/home/gaston/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.7/lib/bundler/runtime.rb:94:in
rescue in block (2 levels) in require': There was an error while trying to load the gem 'faker'. (Bundler::GemRequireError) Gem Load Error is: uninitialized constant Faker::Date Backtrace for gem load error is: /home/gaston/.rvm/gems/ruby-2.3.1/gems/faker-1.8.1/lib/faker/time.rb:2:in
' /home/gaston/.rvm/gems/ruby-2.3.1/gems/faker-1.8.1/lib/faker/time.rb:1:in<top (required)>' /home/gaston/.rvm/gems/ruby-2.3.1/gems/faker-1.8.1/lib/faker.rb:214:in
block in ' /home/gaston/.rvm/gems/ruby-2.3.1/gems/faker-1.8.1/lib/faker.rb:214:ineach' /home/gaston/.rvm/gems/ruby-2.3.1/gems/faker-1.8.1/lib/faker.rb:214:in
' /home/gaston/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.7/lib/bundler/runtime.rb:91:inrequire' /home/gaston/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.7/lib/bundler/runtime.rb:91:in
block (2 levels) in require' /home/gaston/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.7/lib/bundler/runtime.rb:86:ineach' /home/gaston/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.7/lib/bundler/runtime.rb:86:in
block in require' /home/gaston/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.7/lib/bundler/runtime.rb:75:ineach' /home/gaston/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.7/lib/bundler/runtime.rb:75:in
require' /home/gaston/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.7/lib/bundler.rb:106:inrequire' /home/gaston/Workspace/cloud9workspace/projects/time/config/application.rb:7:in
' /home/gaston/.rvm/gems/ruby-2.3.1/gems/railties-5.1.0/lib/rails/commands/server/server_command.rb:128:inrequire' /home/gaston/.rvm/gems/ruby-2.3.1/gems/railties-5.1.0/lib/rails/commands/server/server_command.rb:128:in
block in perform' /home/gaston/.rvm/gems/ruby-2.3.1/gems/railties-5.1.0/lib/rails/commands/server/server_command.rb:125:intap' /home/gaston/.rvm/gems/ruby-2.3.1/gems/railties-5.1.0/lib/rails/commands/server/server_command.rb:125:in
perform' /home/gaston/.rvm/gems/ruby-2.3.1/gems/thor-0.19.4/lib/thor/command.rb:27:inrun' /home/gaston/.rvm/gems/ruby-2.3.1/gems/thor-0.19.4/lib/thor/invocation.rb:126:in
invoke_command' /home/gaston/.rvm/gems/ruby-2.3.1/gems/thor-0.19.4/lib/thor.rb:369:indispatch' /home/gaston/.rvm/gems/ruby-2.3.1/gems/railties-5.1.0/lib/rails/command/base.rb:63:in
perform' /home/gaston/.rvm/gems/ruby-2.3.1/gems/railties-5.1.0/lib/rails/command.rb:44:ininvoke' /home/gaston/.rvm/gems/ruby-2.3.1/gems/railties-5.1.0/lib/rails/commands.rb:16:in
' /home/gaston/Workspace/cloud9workspace/projects/time/bin/rails:9:inrequire' /home/gaston/Workspace/cloud9workspace/projects/time/bin/rails:9:in
' /home/gaston/.rvm/gems/ruby-2.3.1/gems/spring-2.0.2/lib/spring/client/rails.rb:28:inload' /home/gaston/.rvm/gems/ruby-2.3.1/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in
call' /home/gaston/.rvm/gems/ruby-2.3.1/gems/spring-2.0.2/lib/spring/client/command.rb:7:incall' /home/gaston/.rvm/gems/ruby-2.3.1/gems/spring-2.0.2/lib/spring/client.rb:30:in
run' /home/gaston/.rvm/gems/ruby-2.3.1/gems/spring-2.0.2/bin/spring:49:in<top (required)>' /home/gaston/.rvm/gems/ruby-2.3.1/gems/spring-2.0.2/lib/spring/binstub.rb:31:in
load' /home/gaston/.rvm/gems/ruby-2.3.1/gems/spring-2.0.2/lib/spring/binstub.rb:31:in<top (required)>' /home/gaston/Workspace/cloud9workspace/projects/time/bin/spring:13:in
require' /home/gaston/Workspace/cloud9workspace/projects/time/bin/spring:13:in<top (required)>' bin/rails:3:in
load' bin/rails:3:in<main>' Bundler Error Backtrace: from /home/gaston/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.7/lib/bundler/runtime.rb:90:in
block (2 levels) in require' from /home/gaston/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.7/lib/bundler/runtime.rb:86:ineach' from /home/gaston/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.7/lib/bundler/runtime.rb:86:in
block in require' from /home/gaston/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.7/lib/bundler/runtime.rb:75:ineach' from /home/gaston/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.7/lib/bundler/runtime.rb:75:in
require' from /home/gaston/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.7/lib/bundler.rb:106:inrequire' from /home/gaston/Workspace/cloud9workspace/projects/time/config/application.rb:7:in
' from /home/gaston/.rvm/gems/ruby-2.3.1/gems/railties-5.1.0/lib/rails/commands/server/server_command.rb:128:inrequire' from /home/gaston/.rvm/gems/ruby-2.3.1/gems/railties-5.1.0/lib/rails/commands/server/server_command.rb:128:in
block in perform' from /home/gaston/.rvm/gems/ruby-2.3.1/gems/railties-5.1.0/lib/rails/commands/server/server_command.rb:125:intap' from /home/gaston/.rvm/gems/ruby-2.3.1/gems/railties-5.1.0/lib/rails/commands/server/server_command.rb:125:in
perform' from /home/gaston/.rvm/gems/ruby-2.3.1/gems/thor-0.19.4/lib/thor/command.rb:27:inrun' from /home/gaston/.rvm/gems/ruby-2.3.1/gems/thor-0.19.4/lib/thor/invocation.rb:126:in
invoke_command' from /home/gaston/.rvm/gems/ruby-2.3.1/gems/thor-0.19.4/lib/thor.rb:369:indispatch' from /home/gaston/.rvm/gems/ruby-2.3.1/gems/railties-5.1.0/lib/rails/command/base.rb:63:in
perform' from /home/gaston/.rvm/gems/ruby-2.3.1/gems/railties-5.1.0/lib/rails/command.rb:44:ininvoke' from /home/gaston/.rvm/gems/ruby-2.3.1/gems/railties-5.1.0/lib/rails/commands.rb:16:in
' from /home/gaston/Workspace/cloud9workspace/projects/time/bin/rails:9:inrequire' from /home/gaston/Workspace/cloud9workspace/projects/time/bin/rails:9:in
' from /home/gaston/.rvm/gems/ruby-2.3.1/gems/spring-2.0.2/lib/spring/client/rails.rb:28:inload' from /home/gaston/.rvm/gems/ruby-2.3.1/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in
call' from /home/gaston/.rvm/gems/ruby-2.3.1/gems/spring-2.0.2/lib/spring/client/command.rb:7:incall' from /home/gaston/.rvm/gems/ruby-2.3.1/gems/spring-2.0.2/lib/spring/client.rb:30:in
run' from /home/gaston/.rvm/gems/ruby-2.3.1/gems/spring-2.0.2/bin/spring:49:in<top (required)>' from /home/gaston/.rvm/gems/ruby-2.3.1/gems/spring-2.0.2/lib/spring/binstub.rb:31:in
load' from /home/gaston/.rvm/gems/ruby-2.3.1/gems/spring-2.0.2/lib/spring/binstub.rb:31:in<top (required)>' from /home/gaston/Workspace/cloud9workspace/projects/time/bin/spring:13:in
require' from /home/gaston/Workspace/cloud9workspace/projects/time/bin/spring:13:in<top (required)>' from bin/rails:3:in
load' from bin/rails:3:in `'
This are my files: spring.rb
#!/usr/bin/env ruby
# This file loads spring without using Bundler, in order to be fast.
# It gets overwritten when you run the `spring binstub` command.
unless defined?(Spring)
require 'rubygems'
require 'bundler'
if (match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m))
Gem.paths = { 'GEM_PATH' => [Bundler.bundle_path.to_s, *Gem.path].uniq.join(Gem.path_separator) }
gem 'spring', match[1]
require 'spring/binstub'
end
end
Faker was already included in the gemfile, I've updated to the last version. gemfile
gem 'faker', '~> 1.8', '>= 1.8.1'
this is my application.rb, (the first 7 lines) application.rb
require File.expand_path('../boot', __FILE__)
require 'rails/all'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
...
Upvotes: 1
Views: 214
Reputation: 994
There was a problem while updating. I've done the process from scratch and now it works. It had nothing to do with faker.
Upvotes: 1