1

I am a beginner in Rails, and I work on the "Ruby-On-Rails" tutorial created by Michael Hartl. I reached the point where he start to talk about the "rails test" command, but when I ran it, it gave me the following error :

D:/Cours/3eme année/Ruby On Rails/rubyonrails_ebook/workspace/sample_app/test/controllers/static_pages_controller_test.rb:1:in `require': cannot load such file -- test_helper (LoadError)
    from D:/Cours/3eme année/Ruby On Rails/rubyonrails_ebook/workspace/sample_app/test/controllers/static_pages_controller_test.rb:1:in `<top (required)>'
    from D:/Logiciels/Ruby/lib/ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/test_unit/test_requirer.rb:11:in `require'
    from D:/Logiciels/Ruby/lib/ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/test_unit/test_requirer.rb:11:in `block in require_files'
    from D:/Logiciels/Ruby/lib/ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/test_unit/test_requirer.rb:10:in `each'
    from D:/Logiciels/Ruby/lib/ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/test_unit/test_requirer.rb:10:in `require_files'
    from D:/Logiciels/Ruby/lib/ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/test_unit/minitest_plugin.rb:86:in `plugin_rails_init'
    from D:/Logiciels/Ruby/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest.rb:80:in `block in init_plugins'
    from D:/Logiciels/Ruby/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest.rb:78:in `each'
    from D:/Logiciels/Ruby/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest.rb:78:in `init_plugins'
    from D:/Logiciels/Ruby/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest.rb:129:in `run'
    from D:/Logiciels/Ruby/lib/ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/test_unit/minitest_plugin.rb:73:in `run'
    from D:/Logiciels/Ruby/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest.rb:62:in `block in autorun'

So I try to look for an answer, but i didn't manage to find what is the problem. Can someone help please ?

Btw, the "rake test" command is running correctly, but I read that it's different from "rails test". Here are my gems (same as the tutorial) :

source 'https://rubygems.org'

gem 'rails',                   '5.0.1'
gem 'bcrypt',                  '3.1.11'
gem 'faker',                   '1.6.6'
gem 'carrierwave',             '0.11.2'
gem 'mini_magick',             '4.5.1'
gem 'fog',                     '1.38.0'
gem 'will_paginate',           '3.1.0'
gem 'bootstrap-will_paginate', '0.0.10'
gem 'bootstrap-sass',          '3.3.6'
gem 'puma',                    '3.4.0'
gem 'sass-rails',              '5.0.6'
gem 'uglifier',                '3.0.0'
gem 'coffee-rails',            '4.2.1'
gem 'jquery-rails',            '4.1.1'
gem 'turbolinks',              '5.0.1'
gem 'jbuilder',                '2.4.1'

group :development, :test do
  gem 'sqlite3', '1.3.12'
  gem 'byebug',  '9.0.0', platform: :mri
end

group :development do
  gem 'web-console',           '3.1.1'
  gem 'listen',                '3.0.8'
  gem 'spring',                '1.7.2'
  gem 'spring-watcher-listen', '2.0.0'
end

group :test do
  gem 'rails-controller-testing', '0.1.1'
  gem 'minitest-reporters',       '1.1.9'
  gem 'guard',                    '2.13.0'
  gem 'guard-minitest',           '2.4.4'
end

group :production do
  gem 'pg',   '0.18.4'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

Thanks in advance !

3
  • Welcome to Stack Overflow. Please be sure to note or add keywords for everything pertinent to your situation, including your operating system. Also, review this issue for Ruby with uni-code characters in file paths and names. github.com/rubyzip/rubyzip/issues/84 Commented Feb 8, 2017 at 14:54
  • Thanks for your help, you've solved my problem. I'll add all theses informations next time ! Commented Feb 8, 2017 at 15:04
  • Glad that helped. You can answer your own question so that other people who find this question can benefit from the detailed answer. Commented Feb 8, 2017 at 18:45

1 Answer 1

1

So, thanks to J E Carter II, I got the solution : the path of your installation should not include any non uni-code characters in itself.

There is an issue about it on GitHub : as J E Carter II commented

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.