rails server error on ubuntu - ruby-on-rails

I am following ruby on rails getting started guide ( http://guides.rubyonrails.org/getting_started.html )
I installed ruby and rails as it is suggested in the guide but when I try to execute:
bin/rails server
I see the following error in the terminal:
Warning: Running `gem pristine --all` to regenerate your installed gemspecs (and deleting then reinstalling your bundle if you use bundle --path) will improve the startup performance of Spring.
/var/lib/gems/2.1.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 'uglifier'. (Bundler::GemRequireError)
from /var/lib/gems/2.1.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /var/lib/gems/2.1.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `each'
from /var/lib/gems/2.1.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `block in require'
from /var/lib/gems/2.1.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `each'
from /var/lib/gems/2.1.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `require'
from /var/lib/gems/2.1.0/gems/bundler-1.11.2/lib/bundler.rb:99:in `require'
from /home/soroosh/rails/blog/config/application.rb:7:in `<top (required)>'
from /var/lib/gems/2.1.0/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:78:in `require'
from /var/lib/gems/2.1.0/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:78:in `block in server'
from /var/lib/gems/2.1.0/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /var/lib/gems/2.1.0/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:75:in `server'
from /var/lib/gems/2.1.0/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /var/lib/gems/2.1.0/gems/railties-4.2.5.1/lib/rails/commands.rb:17:in `<top (required)>'
from /home/soroosh/rails/blog/bin/rails:9:in `require'
from /home/soroosh/rails/blog/bin/rails:9:in `<top (required)>'
from /var/lib/gems/2.1.0/gems/spring-1.6.3/lib/spring/client/rails.rb:28:in `load'
from /var/lib/gems/2.1.0/gems/spring-1.6.3/lib/spring/client/rails.rb:28:in `call'
from /var/lib/gems/2.1.0/gems/spring-1.6.3/lib/spring/client/command.rb:7:in `call'
from /var/lib/gems/2.1.0/gems/spring-1.6.3/lib/spring/client.rb:28:in `run'
from /var/lib/gems/2.1.0/gems/spring-1.6.3/bin/spring:49:in `<top (required)>'
from /var/lib/gems/2.1.0/gems/spring-1.6.3/lib/spring/binstub.rb:11:in `load'
from /var/lib/gems/2.1.0/gems/spring-1.6.3/lib/spring/binstub.rb:11:in `<top (required)>'
from /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/soroosh/rails/blog/bin/spring:13:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
I am using ubuntu 15.10 , ruby 2.1 and rails4.2.5.1

If you look closely at the error message, this is the important line:
There was an error while trying to load the gem 'uglifier'.
Uglifier is a Javascript wrapper, so it will need a Javascript interpreter. I recommend installing NodeJS:
sudo apt-get install nodejs
read more about uglifier: https://github.com/lautis/uglifier

Related

I'm having problems with libv8 when running rails server on Mac M2 ventura

I had some problems installing ruby ​​2.6.6 in my terminal, and one of them was with libv8 and therubyracer. I was able to solve the problem by installing rosetta 2 and installing the gems as follows
alias ibrew="arch -arm64 brew"
export PATH="/usr/local/homebrew/bin:$PATH"
gem install libv8 -- --with-system-v8
gem install therubyracer -- --with-v8-dir=$(ibrew --prefix v8#3.15)
bundle
But after the bundle ran correctly, another problem appeared that I couldn't solve...
/Users/my_user/.rbenv/versions/2.6.8/lib/ruby/gems/2.6.0/gems/therubyracer-0.12.3/lib/v8.rb:4:in `require': dlopen(/Users/my_user/.rbenv/versions/2.6.8/lib/ruby/gems/2.6.0/gems/therubyracer-0.12.3/lib/v8/init.bundle, 0x0009): symbol not found in flat namespace '__ZN2v810ScriptData10PreCompileEPKci' - /Users/my_user/.rbenv/versions/2.6.8/lib/ruby/gems/2.6.0/gems/therubyracer-0.12.3/lib/v8/init.bundle (LoadError)
from /Users/my_user/.rbenv/versions/2.6.8/lib/ruby/gems/2.6.0/gems/therubyracer-0.12.3/lib/v8.rb:4:in `<top (required)>'
from /Users/my_user/.rbenv/versions/2.6.8/lib/ruby/gems/2.6.0/gems/therubyracer-0.12.3/lib/therubyracer.rb:1:in `require'
from /Users/my_user/.rbenv/versions/2.6.8/lib/ruby/gems/2.6.0/gems/therubyracer-0.12.3/lib/therubyracer.rb:1:in `<top (required)>'
from /Users/my_user/.rbenv/versions/2.6.8/lib/ruby/gems/2.6.0/gems/bundler-1.17.3/lib/bundler/runtime.rb:81:in `require'
from /Users/my_user/.rbenv/versions/2.6.8/lib/ruby/gems/2.6.0/gems/bundler-1.17.3/lib/bundler/runtime.rb:81:in `block (2 levels) in require'
from /Users/my_user/.rbenv/versions/2.6.8/lib/ruby/gems/2.6.0/gems/bundler-1.17.3/lib/bundler/runtime.rb:76:in `each'
from /Users/my_user/.rbenv/versions/2.6.8/lib/ruby/gems/2.6.0/gems/bundler-1.17.3/lib/bundler/runtime.rb:76:in `block in require'
from /Users/my_user/.rbenv/versions/2.6.8/lib/ruby/gems/2.6.0/gems/bundler-1.17.3/lib/bundler/runtime.rb:65:in `each'
from /Users/my_user/.rbenv/versions/2.6.8/lib/ruby/gems/2.6.0/gems/bundler-1.17.3/lib/bundler/runtime.rb:65:in `require'
from /Users/my_user/.rbenv/versions/2.6.8/lib/ruby/gems/2.6.0/gems/bundler-1.17.3/lib/bundler.rb:114:in `require'
from /Users/my_user/projetos/autocommerce/config/application.rb:18:in `<top (required)>'
from /Users/my_user/.rbenv/versions/2.6.8/lib/ruby/gems/2.6.0/gems/railties-5.2.5/lib/rails/command/actions.rb:22:in `require'
from /Users/my_user/.rbenv/versions/2.6.8/lib/ruby/gems/2.6.0/gems/railties-5.2.5/lib/rails/command/actions.rb:22:in `require_application!'
from /Users/my_user/.rbenv/versions/2.6.8/lib/ruby/gems/2.6.0/gems/railties-5.2.5/lib/rails/command/actions.rb:14:in `require_application_and_environment!'
from /Users/my_user/.rbenv/versions/2.6.8/lib/ruby/gems/2.6.0/gems/railties-5.2.5/lib/rails/commands/console/console_command.rb:95:in `perform'
from /Users/my_user/.rbenv/versions/2.6.8/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
from /Users/my_user/.rbenv/versions/2.6.8/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
from /Users/my_user/.rbenv/versions/2.6.8/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
from /Users/my_user/.rbenv/versions/2.6.8/lib/ruby/gems/2.6.0/gems/railties-5.2.5/lib/rails/command/base.rb:69:in `perform'
from /Users/my_user/.rbenv/versions/2.6.8/lib/ruby/gems/2.6.0/gems/railties-5.2.5/lib/rails/command.rb:46:in `invoke'
from /Users/my_user/.rbenv/versions/2.6.8/lib/ruby/gems/2.6.0/gems/railties-5.2.5/lib/rails/commands.rb:18:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
I tried reinstall the gems and the project but nothing works...

Creating new Rails project on Ubuntu returning error

I am currently new to the Linux OS (Ubuntu). I was once learning to develop Rails application on Windows but I found out that it is better to develop Rails applications on Linux since there are some limitations on Windows. I dual booted my computer so I can have Linux and Windows at the same time.
So I installed Ruby and Rails using the RVM (I followed this setup: https://www.youtube.com/watch?v=hiPQynmnsiI) and I created a test project named web and placed it on my desktop. There were no errors prior to the creation of the project but when I ran the command rails s it returned the following:
/home/arjay/.rvm/gems/ruby-2.3.0/gems/bundler-1.13.6/lib/bundler /runtime.rb:94:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'uglifier'. (Bundler::GemRequireError)
Gem Load Error is: Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes.
Backtrace for gem load error is:
/home/arjay/.rvm/gems/ruby-2.3.0/gems/execjs-2.7.0/lib/execjs/runtimes.rb:58:in `autodetect'
/home/arjay/.rvm/gems/ruby-2.3.0/gems/execjs-2.7.0/lib/execjs.rb:5:in `<module:ExecJS>'
/home/arjay/.rvm/gems/ruby-2.3.0/gems/execjs-2.7.0/lib/execjs.rb:4:in `<top (required)>'
/home/arjay/.rvm/gems/ruby-2.3.0/gems/uglifier-3.0.3/lib/uglifier.rb:5:in `require'
/home/arjay/.rvm/gems/ruby-2.3.0/gems/uglifier-3.0.3/lib/uglifier.rb:5:in `<top (required)>'
/home/arjay/.rvm/gems/ruby-2.3.0/gems/bundler-1.13.6/lib/bundler/runtime.rb:91:in `require'
/home/arjay/.rvm/gems/ruby-2.3.0/gems/bundler-1.13.6/lib/bundler/runtime.rb:91:in `block (2 levels) in require'
/home/arjay/.rvm/gems/ruby-2.3.0/gems/bundler-1.13.6/lib/bundler/runtime.rb:86:in `each'
/home/arjay/.rvm/gems/ruby-2.3.0/gems/bundler-1.13.6/lib/bundler/runtime.rb:86:in `block in require'
/home/arjay/.rvm/gems/ruby-2.3.0/gems/bundler-1.13.6/lib/bundler/runtime.rb:75:in `each'
/home/arjay/.rvm/gems/ruby-2.3.0/gems/bundler-1.13.6/lib/bundler/runtime.rb:75:in `require'
/home/arjay/.rvm/gems/ruby-2.3.0/gems/bundler-1.13.6/lib/bundler.rb:106:in `require'
/home/arjay/Desktop/web/config/application.rb:7:in `<top (required)>'
/home/arjay/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:88:in `require'
/home/arjay/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:88:in `block in server'
/home/arjay/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:85:in `tap'
/home/arjay/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:85:in `server'
/home/arjay/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
/home/arjay/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/commands.rb:18:in `<top (required)>'
/home/arjay/Desktop/web/bin/rails:9:in `require'
/home/arjay/Desktop/web/bin/rails:9:in `<top (required)>'
/home/arjay/.rvm/gems/ruby-2.3.0/gems/spring-2.0.0/lib/spring/client/rails.rb:28:in `load'
/home/arjay/.rvm/gems/ruby-2.3.0/gems/spring-2.0.0/lib/spring/client/rails.rb:28:in `call'
/home/arjay/.rvm/gems/ruby-2.3.0/gems/spring-2.0.0/lib/spring/client/command.rb:7:in `call'
/home/arjay/.rvm/gems/ruby-2.3.0/gems/spring-2.0.0/lib/spring/client.rb:30:in `run'
/home/arjay/.rvm/gems/ruby-2.3.0/gems/spring-2.0.0/bin/spring:49:in `<top (required)>'
/home/arjay/.rvm/gems/ruby-2.3.0/gems/spring-2.0.0/lib/spring/binstub.rb:31:in `load'
/home/arjay/.rvm/gems/ruby-2.3.0/gems/spring-2.0.0/lib/spring/binstub.rb:31:in `<top (required)>'
/home/arjay/Desktop/web/bin/spring:14:in `require'
/home/arjay/Desktop/web/bin/spring:14:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'
Bundler Error Backtrace:
from /home/arjay/.rvm/gems/ruby-2.3.0/gems/bundler-1.13.6/lib/bundler/runtime.rb:90:in `block (2 levels) in require'
from /home/arjay/.rvm/gems/ruby-2.3.0/gems/bundler-1.13.6/lib/bundler/runtime.rb:86:in `each'
from /home/arjay/.rvm/gems/ruby-2.3.0/gems/bundler-1.13.6/lib/bundler/runtime.rb:86:in `block in require'
from /home/arjay/.rvm/gems/ruby-2.3.0/gems/bundler-1.13.6/lib/bundler/runtime.rb:75:in `each'
from /home/arjay/.rvm/gems/ruby-2.3.0/gems/bundler-1.13.6/lib/bundler/runtime.rb:75:in `require'
from /home/arjay/.rvm/gems/ruby-2.3.0/gems/bundler-1.13.6/lib/bundler.rb:106:in `require'
from /home/arjay/Desktop/web/config/application.rb:7:in `<top (required)>'
from /home/arjay/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:88:in `require'
from /home/arjay/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:88:in `block in server'
from /home/arjay/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:85:in `tap'
from /home/arjay/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:85:in `server'
from /home/arjay/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
from /home/arjay/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/commands.rb:18:in `<top (required)>'
from /home/arjay/Desktop/web/bin/rails:9:in `require'
from /home/arjay/Desktop/web/bin/rails:9:in `<top (required)>'
from /home/arjay/.rvm/gems/ruby-2.3.0/gems/spring-2.0.0/lib/spring/client/rails.rb:28:in `load'
from /home/arjay/.rvm/gems/ruby-2.3.0/gems/spring-2.0.0/lib/spring/client/rails.rb:28:in `call'
from /home/arjay/.rvm/gems/ruby-2.3.0/gems/spring-2.0.0/lib/spring/client/command.rb:7:in `call'
from /home/arjay/.rvm/gems/ruby-2.3.0/gems/spring-2.0.0/lib/spring/client.rb:30:in `run'
from /home/arjay/.rvm/gems/ruby-2.3.0/gems/spring-2.0.0/bin/spring:49:in `<top (required)>'
from /home/arjay/.rvm/gems/ruby-2.3.0/gems/spring-2.0.0/lib/spring/binstub.rb:31:in `load'
from /home/arjay/.rvm/gems/ruby-2.3.0/gems/spring-2.0.0/lib/spring/binstub.rb:31:in `<top (required)>'
from /home/arjay/Desktop/web/bin/spring:14:in `require'
from /home/arjay/Desktop/web/bin/spring:14:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
Thank you for anyone who can help me out!
Could not find a JavaScript runtime.
You need javascript runtime.
Solution 1: Run the following command install nodejs
sudo apt-get install nodejs
Solution 2: Add therubyracer gem in your Gemfile
gem 'therubyracer'
This will solve the issue
You should run
sudo apt-get install nodejs
For Reference follow url
click here

Error when launching a new rails app in Ubuntu 14.04

I am trying to create a new rails app on Ubuntu 14.04. This is my first time using Rails in Ubuntu, (previously developed in Windows 10). I set up the development environment, my ruby version is ruby 2.3.0p0 and rails version is 5.0.0. Once my dev environment was set up, I started a new project by typing in a terminal:
rails new MyApp
Then, I typed:
cd MyApp
bundle install
And finally, I attempted to start my rails server by typing:
rails s
Instead of the rails server starting, I get this response in the terminal:
/home/rusty/.rvm/gems/ruby-2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:89:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'uglifier'. (Bundler::GemRequireError)
Gem Load Error is: Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes.
Backtrace for gem load error is:
/home/rusty/.rvm/gems/ruby-2.3.0/gems/execjs-2.7.0/lib/execjs/runtimes.rb:58:in `autodetect'
/home/rusty/.rvm/gems/ruby-2.3.0/gems/execjs-2.7.0/lib/execjs.rb:5:in `<module:ExecJS>'
/home/rusty/.rvm/gems/ruby-2.3.0/gems/execjs-2.7.0/lib/execjs.rb:4:in `<top (required)>'
/home/rusty/.rvm/gems/ruby-2.3.0/gems/uglifier-3.0.0/lib/uglifier.rb:5:in `require'
/home/rusty/.rvm/gems/ruby-2.3.0/gems/uglifier-3.0.0/lib/uglifier.rb:5:in `<top (required)>'
/home/rusty/.rvm/gems/ruby-2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:in `require'
/home/rusty/.rvm/gems/ruby-2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:in `block (2 levels) in require'
/home/rusty/.rvm/gems/ruby-2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in `each'
/home/rusty/.rvm/gems/ruby-2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in `block in require'
/home/rusty/.rvm/gems/ruby-2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `each'
/home/rusty/.rvm/gems/ruby-2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `require'
/home/rusty/.rvm/gems/ruby-2.3.0/gems/bundler-1.12.5/lib/bundler.rb:102:in `require'
/home/rusty/Maple/config/application.rb:7:in `<top (required)>'
/home/rusty/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:88:in `require'
/home/rusty/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:88:in `block in server'
/home/rusty/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:85:in `tap'
/home/rusty/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:85:in `server'
/home/rusty/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
/home/rusty/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0/lib/rails/commands.rb:18:in `<top (required)>'
/home/rusty/Maple/bin/rails:9:in `require'
/home/rusty/Maple/bin/rails:9:in `<top (required)>'
/home/rusty/.rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/client/rails.rb:28:in `load'
/home/rusty/.rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/client/rails.rb:28:in `call'
/home/rusty/.rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/client/command.rb:7:in `call'
/home/rusty/.rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/client.rb:30:in `run'
/home/rusty/.rvm/gems/ruby-2.3.0/gems/spring-1.7.2/bin/spring:49:in `<top (required)>'
/home/rusty/.rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/binstub.rb:11:in `load'
/home/rusty/.rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/binstub.rb:11:in `<top (required)>'
/home/rusty/Maple/bin/spring:13:in `require'
/home/rusty/Maple/bin/spring:13:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'
Bundler Error Backtrace:
from /home/rusty/.rvm/gems/ruby-2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:85:in `block (2 levels) in require'
from /home/rusty/.rvm/gems/ruby-2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in `each'
from /home/rusty/.rvm/gems/ruby-2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in `block in require'
from /home/rusty/.rvm/gems/ruby-2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `each'
from /home/rusty/.rvm/gems/ruby-2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `require'
from /home/rusty/.rvm/gems/ruby-2.3.0/gems/bundler-1.12.5/lib/bundler.rb:102:in `require'
from /home/rusty/Maple/config/application.rb:7:in `<top (required)>'
from /home/rusty/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:88:in `require'
from /home/rusty/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:88:in `block in server'
from /home/rusty/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:85:in `tap'
from /home/rusty/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:85:in `server'
from /home/rusty/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
from /home/rusty/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0/lib/rails/commands.rb:18:in `<top (required)>'
from /home/rusty/Maple/bin/rails:9:in `require'
from /home/rusty/Maple/bin/rails:9:in `<top (required)>'
from /home/rusty/.rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/client/rails.rb:28:in `load'
from /home/rusty/.rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/client/rails.rb:28:in `call'
from /home/rusty/.rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/client/command.rb:7:in `call'
from /home/rusty/.rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/client.rb:30:in `run'
from /home/rusty/.rvm/gems/ruby-2.3.0/gems/spring-1.7.2/bin/spring:49:in `<top (required)>'
from /home/rusty/.rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/binstub.rb:11:in `load'
from /home/rusty/.rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/binstub.rb:11:in `<top (required)>'
from /home/rusty/Maple/bin/spring:13:in `require'
from /home/rusty/Maple/bin/spring:13:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
My app was created successfully. All the appropriate files are located in my app's folder. I just can't seem to get the rails server to start.
I found a solution. Open a terminal and change to your app's directory. Example, type cd MyApp.
Then install the Rubyracer gem by typing gem install therubyracer in your terminal, and then add gem 'therubyracer' to your gemfile.
My rails server starts now. Thank you uDaY for helping me.

Cannot start WEBrick server. Mysql2 `require': cannot load such file

I have installed a fresh install of Ruby / Rails on an clean Windows 8 install and amy getting errors when trying to start the WEBrick server. Have searched for an answer but cant find one.
Error as below:
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/mysql2-0.3.18-x64-mingw32/lib/mysql2/mysql2.rb:2:in `require': cannot load such file -- mysql2/2.2/mysql2 (LoadError)
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/mysql2-0.3.18-x64-mingw32/lib/mysql2/mysql2.rb:2:in `<top (required)>'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/mysql2-0.3.18-x64-mingw32/lib/mysql2.rb:31:in `require'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/mysql2-0.3.18-x64-mingw32/lib/mysql2.rb:31:in `<top (required)>'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.9.4/lib/bundler/runtime.rb:76:in `require'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.9.4/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.9.4/lib/bundler/runtime.rb:72:in `each'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.9.4/lib/bundler/runtime.rb:72:in `block in require'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.9.4/lib/bundler/runtime.rb:61:in `each'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.9.4/lib/bundler/runtime.rb:61:in `require'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.9.4/lib/bundler.rb:134:in `require'
from C:/Users/Brendon/Sites/quote/config/application.rb:7:in `<top (required)>'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:78:in `require'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:78:in `block in server'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:75:in `tap'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:75:in `server'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
Any help greatly appreciated
You need to use bundler to install the gem first.
Either do:
gem install mysql2
or
cd /my/rails/project && bundle install
note: the mysql2 gem is a [expletive] to install... best of luck

Active_support/dependencies.rb:247 `require': cannot load such file -- 2.1/pg_ext (LoadError)

I'm using Ruby 2.1.5, Rails 4.1.6 and PostgreSQL 9.3.5 on a Windows machine.
When I try to bundle exec rails server, I end up with the following error:
DL is deprecated, please use Fiddle
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:247:in `require': cannot load such file -- 2.1/pg_ext (LoadError)
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:247:in `block in re...re'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:232:in `load_dependancy'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:247:in `require'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/pg-0.17.1-x86-mingw32/lib/pg.rb:10:in `rescue in <top (required)>'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/pg-0.17.1-x86-mingw32/lib/pg.rb:3:in `<top (required)>'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.7.7/lib/bundler/runtime.rb:76:in `require'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.7.7/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.7.7/lib/bundler/runtime.rb:72:in `each'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.7.7/lib/bundler/runtime.rb:72:in `block in require'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.7.7/lib/bundler/runtime.rb:61:in `each'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.7.7/lib/bundler/runtime.rb:61:in `require'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.7.7/lib/bundler.rb:133:in `require'
from C:/....../config/application.rb:5:in `<top (required)>'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.6/lib/rails/commands/commands_tasks.rb:79:in `require'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.6/lib/rails/commands/commands_tasks.rb:79:in `block in server
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.6/lib/rails/commands/commands_tasks.rb:76:in `tap'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.6/lib/rails/commands/commands_tasks.rb:76:in `server'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.6/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.6/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:8:in `require'
from bin/rails:8:in `<main>'
I needed to use a newer version of pg gem:
gem 'pg', '~> 0.18.0.pre20141117110243'
After updating, sometimes happens.
Try remove all gems and install all again. like
rm -rf ./vendor/bundle
bundle install

Resources