rails s command not working - ruby-on-rails

Hello I am working with ruby on rails on a windows 8 machine and I am having a hard time setting up ruby 2.1 on my machine. when I run rails s I get the following error:
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/execjs-2.2.0/lib/execjs/run
times.rb:51:in `autodetect': Could not find a JavaScript runtime. See https://gi
thub.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUn
available)
from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/execjs-2.2.0/l
ib/execjs.rb:5:in `<module:ExecJS>'
from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/execjs-2.2.0/l
ib/execjs.rb:4:in `<top (required)>'
from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/uglifier-2.5.1
/lib/uglifier.rb:3:in `require'
from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/uglifier-2.5.1
/lib/uglifier.rb:3:in `<top (required)>'
from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/bundler-1.6.3/
lib/bundler/runtime.rb:76:in `require'
from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/bundler-1.6.3/
lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/bundler-1.6.3/
lib/bundler/runtime.rb:72:in `each'
from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/bundler-1.6.3/
lib/bundler/runtime.rb:72:in `block in require'
from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/bundler-1.6.3/
lib/bundler/runtime.rb:61:in `each'
from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/bundler-1.6.3/
lib/bundler/runtime.rb:61:in `require'
from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/bundler-1.6.3/
lib/bundler.rb:132:in `require'
from C:/HandCo-op/HandCo-op/config/application.rb:7:in `<top (required)>
'
from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.1.2
.rc1/lib/rails/commands/commands_tasks.rb:79:in `require'
from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.1.2
.rc1/lib/rails/commands/commands_tasks.rb:79:in `block in server'
from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.1.2
.rc1/lib/rails/commands/commands_tasks.rb:76:in `tap'
from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.1.2
.rc1/lib/rails/commands/commands_tasks.rb:76:in `server'
from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.1.2
.rc1/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.1.2
.rc1/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
I think this is because I need ruby 2.1 and the version installed is 2.0. Does anyone know what I should do to fix these errors? Thanks a lot anyone who has an idea on why I can not run rails s.

It's funny, I had just initialized a new rails 4 project with ruby 2.1 and when forgetting to update the Gemfile I got the exact error message a few minutes ago.
Update your Gemfile uncommenting the gem 'therubyracer' line, so it looks like:
# Gemfile
gem 'therubyracer', platforms: :ruby
Run the bundle command after updating the Gemfile.
The error message is because you don't have a runtime installed.
Update: Options on Windows
I've had success installing and using closure-compiler gem on Windows 7+ x64 arch. My development box switches from linux to windows from time to time so following is how I have my Gemfile setup:
# Gemfile
gem 'therubyracer', :platforms => :ruby
gem 'execjs', :platforms => :ruby
gem 'closure-compiler'
And update your configuration for either of your environments in config/environments/ or app wide in config/application.rb by updating the following line:
config.assets.js_compressor = :closure
Please see Customizing the Pipeline for further information at RailsGuide.

Related

I can´t run server in Ubuntu 14.02 with ruby 2.2.2 and Rails 4

I´ve a problem when run Rails server. I just installed gem server, but still not working. I am new to the world of programming . I am grateful to anyone who can help me.
Copy an image of the error: http://i.stack.imgur.com/wS7oS.png.
/home/hugo/.rvm/gems/ruby-2.2.2/gems/activesupport-4.0.5/lib/active_support/values/time_zone.rb:283: warning: circular argument reference - now
/home/hugo/.rvm/gems/ruby-2.2.2/gems/execjs-2.5.2/lib/execjs/runtimes.rb:48:in `autodetect': Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
from /home/hugo/.rvm/gems/ruby-2.2.2/gems/execjs-2.5.2/lib/execjs.rb:5:in `<module:ExecJS>'
from /home/hugo/.rvm/gems/ruby-2.2.2/gems/execjs-2.5.2/lib/execjs.rb:4:in `<top (required)>'
from /home/hugo/.rvm/gems/ruby-2.2.2/gems/uglifier-2.7.1/lib/uglifier.rb:3:in `require'
from /home/hugo/.rvm/gems/ruby-2.2.2/gems/uglifier-2.7.1/lib/uglifier.rb:3:in `<top (required)>'
from /home/hugo/.rvm/gems/ruby-2.2.2/gems/bundler-1.10.2/lib/bundler/runtime.rb:76:in `require'
from /home/hugo/.rvm/gems/ruby-2.2.2/gems/bundler-1.10.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /home/hugo/.rvm/gems/ruby-2.2.2/gems/bundler-1.10.2/lib/bundler/runtime.rb:72:in `each'
from /home/hugo/.rvm/gems/ruby-2.2.2/gems/bundler-1.10.2/lib/bundler/runtime.rb:72:in `block in require'
from /home/hugo/.rvm/gems/ruby-2.2.2/gems/bundler-1.10.2/lib/bundler/runtime.rb:61:in `each'
from /home/hugo/.rvm/gems/ruby-2.2.2/gems/bundler-1.10.2/lib/bundler/runtime.rb:61:in `require'
from /home/hugo/.rvm/gems/ruby-2.2.2/gems/bundler-1.10.2/lib/bundler.rb:133:in `require'
from /home/hugo/pin_board/config/application.rb:7:in `<top (required)>'
from /home/hugo/.rvm/gems/ruby-2.2.2/gems/railties-4.0.5/lib/rails/commands.rb:74:in `require'
from /home/hugo/.rvm/gems/ruby-2.2.2/gems/railties-4.0.5/lib/rails/commands.rb:74:in `block in <top (required)>'
from /home/hugo/.rvm/gems/ruby-2.2.2/gems/railties-4.0.5/lib/rails/commands.rb:71:in `tap'
from /home/hugo/.rvm/gems/ruby-2.2.2/gems/railties-4.0.5/lib/rails/commands.rb:71:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
This seems like a similar question to ExecJS and could not find a JavaScript runtime. The resolution here was to ensure NodeJS was installed on the machine:
sudo apt-get install nodejs
uncomment
gem 'therubyracer', platforms: :ruby
in your Gemfile.
Please do
bundle install
after adding 'therubyracer' gem

Rails 4.2 web-console issue

After upgrading to Rails 4.2, I was excited to try out the newly integrated web-console, but I'm having some issues.
In the release notes for Rails 4.2, it mentions: "New applications generated with Rails 4.2 now come with the Web Console gem by default."
Since I upgraded to 4.2, I assume that means I will still have to specify it in my Gemfile. Without adding it to my Gemfile, rails just gives me "undefined local variable or method `console'" so I assume that to be the case.
Once I added gem 'web-console', '~> 2.0' to the Gemfile, and run rails server, I now get:
/home/kevin/.rvm/gems/ruby-2.1.5/gems/binding_of_caller-0.7.3.pre1/lib/binding_of_caller/mri2.rb:21:in `callers': uninitialized constant RubyVM::DebugInspector (NameError)
from /home/kevin/.rvm/gems/ruby-2.1.5/gems/better_errors-2.0.0/lib/better_errors/exception_extension.rb:7:in `set_backtrace'
from /home/kevin/.rvm/gems/ruby-2.1.5#global/gems/bundler-1.7.6/lib/bundler/runtime.rb:76:in `require'
from /home/kevin/.rvm/gems/ruby-2.1.5#global/gems/bundler-1.7.6/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /home/kevin/.rvm/gems/ruby-2.1.5#global/gems/bundler-1.7.6/lib/bundler/runtime.rb:72:in `each'
from /home/kevin/.rvm/gems/ruby-2.1.5#global/gems/bundler-1.7.6/lib/bundler/runtime.rb:72:in `block in require'
from /home/kevin/.rvm/gems/ruby-2.1.5#global/gems/bundler-1.7.6/lib/bundler/runtime.rb:61:in `each'
from /home/kevin/.rvm/gems/ruby-2.1.5#global/gems/bundler-1.7.6/lib/bundler/runtime.rb:61:in `require'
from /home/kevin/.rvm/gems/ruby-2.1.5#global/gems/bundler-1.7.6/lib/bundler.rb:133:in `require'
from /home/kevin/workspace/applications/ems-heroes/config/application.rb:6:in `<top (required)>'
from /home/kevin/.rvm/gems/ruby-2.1.5/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:78:in `require'
from /home/kevin/.rvm/gems/ruby-2.1.5/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:78:in `block in server'
from /home/kevin/.rvm/gems/ruby-2.1.5/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /home/kevin/.rvm/gems/ruby-2.1.5/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `server'
from /home/kevin/.rvm/gems/ruby-2.1.5/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /home/kevin/.rvm/gems/ruby-2.1.5/gems/railties-4.2.0/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
I googled around and didnt find much. Any advice is greatly appreciated.
Thanks!
It turned out that my issue was coming from the dependency 'debug_inspector'.
Thanks to this: https://github.com/banister/binding_of_caller/issues/39
I just had to run:
$ gem uninstall debug_inspector
$ bundle install

ruby tutorial to launch my app

i'm just starting with an Unix based OS
i installed RVM to do the same basic tutorial like windows(dos), but i get
an error, i tried to do the same work in root/user shell but is the same
when i run rails server i get this message:
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/execjs-2.0.1/lib/execjs/runtimes.rb:51:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/execjs-2.0.1/lib/execjs.rb:5:in `<module:ExecJS>'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/execjs-2.0.1/lib/execjs.rb:4:in `<top (required)>'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/uglifier-2.2.1/lib/uglifier.rb:3:in `require'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/uglifier-2.2.1/lib/uglifier.rb:3:in `<top (required)>'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
from /home/raul/blog/config/application.rb:7:in `<top (required)>'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/commands.rb:76:in `require'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/commands.rb:76:in `block in <top (required)>'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/commands.rb:73:in `tap'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/commands.rb:73:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
i reviwed the gem command and dome problems was founded too. Execjs is installed several times in my machine, root->user. This is what i get with gem check:
json-1.8.0.gem has 12 problems
ext/json/ext/generator/.RUBYARCHDIR.time:
Extra file
ext/json/ext/generator/Makefile:
Extra file
ext/json/ext/generator/generator.o:
Extra file
ext/json/ext/generator/generator.so:
Extra file
ext/json/ext/generator/siteconf20130920-14093-1b8hzo9.rb:
Extra file
ext/json/ext/parser/.RUBYARCHDIR.time:
Extra file
ext/json/ext/parser/Makefile:
Extra file
ext/json/ext/parser/parser.o:
Extra file
ext/json/ext/parser/parser.so:
Extra file
ext/json/ext/parser/siteconf20130920-14093-zefm93.rb:
Extra file
lib/json/ext/generator.so:
Extra file
lib/json/ext/parser.so:
Extra file
Just add a JavaScript runtime to your Gemfile (for example, execJS): gem 'execjs'
Then, just run bundle install and it should work.
Install node
sudo apt-get install nodejs
followed by
gem install execjs
or just put gem 'execjs' in your gemfile.
EDIT: i'm editing my answer based on your edits and comments.

cannot load such file -- 1.9/bcrypt_ext (LoadError)

Hey I get the following Error when i try to start the rails server
Any ideas? At the moment no possible solution worked...
By the way I run Windows 8... might be the problem at all :D
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- 1.9/bcry
pt_ext (LoadError)
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `block in require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:236:in `load_dependency'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bcrypt-ruby-3.1.0-x86-mingw32/lib/bcrypt_ext.rb:2:in `<top (required)>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `block in require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:236:in `load_dependency'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bcrypt-ruby-3.1.0-x86-mingw32/lib/bcrypt.rb:12:in `<top (required)>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/lib/bundler/runtime.rb:72:in `require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/lib/bundler/runtime.rb:70:in `each'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/lib/bundler/runtime.rb:70:in `block in require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/lib/bundler/runtime.rb:59:in `each'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/lib/bundler/runtime.rb:59:in `require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/lib/bundler.rb:132:in `require'
from C:/Users/Enno/RubymineProjects/BookWriting2.0/config/application.rb:13:in `<top (required)>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.11/lib/rails/commands.rb:24:in `require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.11/lib/rails/commands.rb:24:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
This morning, I'm facing the same issue too (Windows 7).
Let me recommend to have a look here
https://github.com/codahale/bcrypt-ruby/issues/72
I successfully fix my problem like this (updating my Gemfile):
gem 'bcrypt-ruby', '3.1.1.rc1', :require => 'bcrypt'
If you have problems with the gem bcrypt, follow these steps:
1. Change to the gem directory found by bundle show bcrypt + ext\mri\, for example: c:\RailsInstaller\Ruby2.2.3\lib\ruby\gems\2.2.0\gems\bcrypt-3.1.10-x86-mingw32\ext\mri
2. run ruby extconf.rb
3. run make
4. make install
Note that this works only if your DevKit environment is correctly setup (run devkitvars.bat).
I encountered a similar issue but with Ruby 2.0 and Rails 3.2.15 on Windows. It now requires at least 3.1.2:
gem 'bcrypt-ruby', '~> 3.1.2'
Link:
https://github.com/rails/rails/pull/12325
Comment off "gem 'bcrypt-ruby', '~> 3.0.0'" in your gemfile
this should be work
The relevant version will constantly change. You can find the newest stable version number here: rubygems.org/gems/bcrypt-ruby
If anyone is still having issues with this (especially with devise) on Windows 64 bit, try installing Ruby 64 bit, then rails as a gem (rather than using the rails installer) and then add:
gem 'bcrypt-ruby', '~> 3.0.0', :require => "bcrypt"
You may need to change your tzinfo-data gem to:
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw]

'rails console' command throwing error in Rails 3.2.9

I am using Rails 3.2.9 with ruby 1.9.3 (made default using RVM). From the root directory of my test_app when I executed the command 'rails console' / 'rails c', the following error is showing.
rails console
/home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327/gems/execjs-1.4.0/lib/execjs/runtimes.rb:51:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327/gems/execjs-1.4.0/lib/execjs.rb:5:in `<module:ExecJS>'
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327/gems/execjs-1.4.0/lib/execjs.rb:4:in `<top (required)>'
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `require'
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `<top (required)>'
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `require'
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `<top (required)>'
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `require'
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `<top (required)>'
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.2.3/lib/bundler/runtime.rb:68:in `require'
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.2.3/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.2.3/lib/bundler/runtime.rb:66:in `each'
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.2.3/lib/bundler/runtime.rb:66:in `block in require'
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.2.3/lib/bundler/runtime.rb:55:in `each'
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.2.3/lib/bundler/runtime.rb:55:in `require'
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.2.3/lib/bundler.rb:128:in `require'
from /home/local/rajesh.co/Rajesh/blog/config/application.rb:7:in `<top (required)>'
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.9/lib/rails/commands.rb:39:in `require'
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.9/lib/rails/commands.rb:39:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Can anyone help me to resolve this?
Yes, I got the answer for my question.
Just Open the file 'Gemfile' inside the root directory of your application folder, and then paste the below lines there.
gem 'execjs'
gem 'libv8'
gem 'therubyracer'
After pasting it, just save the file and execute 'bundle update' on the command prompt.
On finishing bundle update successfully, you try running 'rails c' or 'rails console' for taking the rails console. It works!!
Thank you.
Install the folowing both:
gem 'execjs'
gem 'therubyracer'
Try installing
gem 'therubyracer'
Source

Resources