I am a beginner in programming.
Currently, I am learning along with the Ruby on Rails 5 Quick Learning Practice Guide that can be used on site.
Create p14 User class and save it in the count directory.
In order to use the User class, an error appears in the part that starts irb and loads user.rb using require.
user.rb is stored in /home/kei displayed as pwd in ubuntu.
I would appreciate it if you could tell me how to solve it.
Applicable source code
[email protected]:~$irb irb(main):001:0>require'./user.rb' Traceback (most recent call last): 4: from /home/kei/.rbenv/versions/2.5.8/bin/irb:11:in `<main>' 3: from (irb):1 2: from /home/kei/.rbenv/versions/2.5.8/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:92:in `require' 1: from /home/kei/.rbenv/versions/2.5.8/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:92:in `require' LoadError (cannot load such file-./user.rb) irb(main):002:0>
What I tried
class User end
・Execute with require_relative
Traceback (most recent call last):
3: from /home/kei/.rbenv/versions/2.5.8/bin/irb:11:in
LoadError (cannot load such file --/home/kei/user.rb)
Answer # 1
---------- 1 kei kei 15 Jul 28 11:15 user.rb
So no one has access.
chmod 766 user.rb
- ruby - loaderror: cannot load such file --capybara/rspec occurs when executing bin/rspec
- ruby on rails runtime error cannot be resolved
- ruby - i entered secret_key_base, but http error 500 cannot be resolved
- ruby on rails - syntax error cannot be resolved
- ruby - when i push (), i get the error [vue warn]: error in render: "typeerror: cannot read property'text' of undefined&quo
- ruby on rails - [rails] type error no implicit conversion of nil into string in the controller when introducing the gurunavi api
- ruby - activerecord :: recordnotfound shows that the id cannot be found
- ruby - i get an error with automatic deployment on capistrano
- ruby on rails - when i changed the data type, i got an sql error i don't know where the cause is
- ruby - [rails] cannot refer to the relation destination table
- ruby - error when deploying on heroku
- python 3x - when i install pycrypto with python pip, i get an error and cannot complete the installation
- error when implementing search function using ransack in ruby on rails
- ruby on rails - about variable error of rails like function
- sql execution result cannot be received and displayed in ruby
- ruby - routing error no route matches [post] appears
- i want to resolve the error statement (ruby on rails)
- ruby on rails 5 - "thin" error when installing gem
- ruby on rails 5 - cannot check the existence of a child model that has a parent-child relationship
- ruby bcrypt cannot be installed
- ruby - sass :: syntaxerror on rails s
- ruby - i want to make the test successful
- i want to output all ruby on rails flash messages
- ruby - about active storage
- ruby - "fe_sendauth: no password supplied" occurs in development environment
- ruby - i want to create a database on aws
- ruby - i want rails controller @user = userwhere (logged user's date of birth + -3 years)
- ruby - rails5 devise how to receive hash at date_select
- ruby - rails bootstrap 3 column layout
- ruby - actioncontroller :: urlgenerationerror when validating rails comment function