LoadError causing Server not to start - ruby-on-rails

Can anybody explain this for me?
$ rails s
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sqlite3-1.3.7-x86-mingw32/lib/sqlite3.rb:6:in `require': cannot load such file -- sqlite3/sqlite3_native (LoadError)
from c:/Ruby200/lib/ruby/gems/2.0.0/gems/sqlite3-1.3.7-x86-mingw32/lib/sqlite3.rb:6:in `rescue in <top (required)>'
from c:/Ruby200/lib/ruby/gems/2.0.0/gems/sqlite3-1.3.7-x86-mingw32/lib/sqlite3.rb:2:in `<top (required)>'
from c:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
from c:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
from c:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
from c:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
from c:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
from c:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
from c:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
from C:/Users/Sam/Documents/Aptana Studio 3 Workspace/First With Book/config/application.rb:7:in `<top (required)>'
from c:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:76:in `require'
from c:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:76:in `block in <top (required)>'
from c:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:73:in `tap'
from c:/Ruby200/lib/ruby/gems/2.0.0/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>'
Its my first rails program and I was following a rails tutorial which changed the gemfile but it hasn't worked, I guess I haven't installed something, I'm running gems 2.0.3 and rails 4.0.0 and with ruby I get this:
$ ruby -v
ruby 2.0.0p247 (2013-06-27) [i386-mingw32]

From here
download the required executable and the dll from http://www.sqlite.org/download.html extract to your ruby's bin (c:\Ruby200\bin)

Related

rails generate scaffold User name:string email:string

Whilst doing https://www.railstutorial.org/book/toy_app tutorial in section 2.2 where I had to write: $ rails generate scaffold User name:string email:string, I got some errors:
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/web-console-2.0.0.beta3/lib/web_console/slave.rb:1:in `require': cannot load such file -- pty (LoadError)
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/web-console-2.0.0.beta3/lib/web_console/slave.rb:1:in `<top (required)>'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/web-console-2.0.0.beta3/lib/web_console.rb:13:in `require'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/web-console-2.0.0.beta3/lib/web_console.rb:13:in `<top (required)>'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/web-console-2.0.0.beta3/lib/web-console.rb:1:in `require'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/web-console-2.0.0.beta3/lib/web-console.rb:1:in `<top (required)>'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `require'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/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.10.6/lib/bundler/runtime.rb:72:in `each'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `block in require'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `each'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `require'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler.rb:134:in `require'
from c:/Users/User/desktop/web/workspace/toy_app/config/application.rb:7:in `<top (required)>'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:141:in `require'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:141:in `require_application_and_environment!'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:128:in `generate_or_destroy'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:50:in `generate'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.2.2/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
Any suggestions? It has been bugging me whole day
The issue is that Rails 4.2.0beta and above have a dependency on the pty gem and it is unable to find it.
`require': cannot load such file -- pty (LoadError)
This is due to the fact that this gem is not yet available on Windows. For a temporary fix you can remove the web-console gem from your Gemfile and run bundle install after removing that gem.

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

Error with rails s

So when I try to fire up my server using rails s I get
/usr/local/rvm/gems/ruby-2.0.0-p481#railstutorial_rails_4_0/gems/sqlite3-1.3.8/lib/sqlite3.rb:6:in `require': cannot load such file -- sqlite3/sqlite3_native (LoadError)
from /usr/local/rvm/gems/ruby-2.0.0-p481#railstutorial_rails_4_0/gems/sqlite3-1.3.8/lib/sqlite3.rb:6:in `rescue in <top (required)>'
from /usr/local/rvm/gems/ruby-2.0.0-p481#railstutorial_rails_4_0/gems/sqlite3-1.3.8/lib/sqlite3.rb:2:in `<top (required)>'
from /usr/local/rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.2/lib/bundler/runtime.rb:76:in `require'
from /usr/local/rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /usr/local/rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.2/lib/bundler/runtime.rb:72:in `each'
from /usr/local/rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.2/lib/bundler/runtime.rb:72:in `block in require'
from /usr/local/rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.2/lib/bundler/runtime.rb:61:in `each'
from /usr/local/rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.2/lib/bundler/runtime.rb:61:in `require'
from /usr/local/rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.2/lib/bundler.rb:132:in `require'
from /Users/idrisk/rails_projects/first_app/config/application.rb:7:in `<top (required)>'
from /usr/local/rvm/gems/ruby-2.0.0-p481#railstutorial_rails_4_0/gems/railties-4.0.5/lib/rails/commands.rb:74:in `require'
from /usr/local/rvm/gems/ruby-2.0.0-p481#railstutorial_rails_4_0/gems/railties-4.0.5/lib/rails/commands.rb:74:in `block in <top (required)>'
from /usr/local/rvm/gems/ruby-2.0.0-p481#railstutorial_rails_4_0/gems/railties-4.0.5/lib/rails/commands.rb:71:in `tap'
from /usr/local/rvm/gems/ruby-2.0.0-p481#railstutorial_rails_4_0/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>'
I've tried using sudo also, but then I get
/usr/local/rvm/rubies/ruby-2.0.0-p481/lib/ruby/site_ruby/2.0.0/rubygems/dependency.rb:247:in `to_specs': Could not find railties (>= 0) amongst [bundler-1.6.2, bundler-unload-1.0.2, executable-hooks-1.3.1, gem-wrappers-1.2.4, rubygems-bundler-1.4.3, rvm-1.11.3.9] (Gem::LoadError)
from /usr/local/rvm/rubies/ruby-2.0.0-p481/lib/ruby/site_ruby/2.0.0/rubygems/dependency.rb:256:in `to_spec'
from /usr/local/rvm/rubies/ruby-2.0.0-p481/lib/ruby/site_ruby/2.0.0/rubygems.rb:1231:in `gem'
from /usr/local/rvm/gems/ruby-2.0.0-p481#railstutorial_rails_4_0/bin/rails:18:in `<main>'
from /usr/local/rvm/gems/ruby-2.0.0-p481#railstutorial_rails_4_0/bin/ruby_executable_hooks:15:in `eval'
from /usr/local/rvm/gems/ruby-2.0.0-p481#railstutorial_rails_4_0/bin/ruby_executable_hooks:15:in `<main>'
I'm not really sure what this means. I've tried restarting and things in that sort of nature. But nothing seemed to work. Ideas?
Try updating Ruby and Rails with RVM - RVM is a command-line tool which allows you to easily install, manage, and work with multiple ruby environments from interpreters to sets of gems.
Here is the website: https://rvm.io/

rails server throws `require': cannot load such file -- bigdecimal/util (LoadError)

In Rails 3.2.12, when I run rails s it throws
/usr/local/share/gems/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- bigdecimal/util (LoadError)
I even added gem 'bigdecimal' to Gemfile but still I am getting the same error, any pointers?
I had this issue with Rails 5.0.2 on a brand new Rails-generated application. The problem was that bigdecimal was not being loaded from my updated gemset but from the ruby-2.3.0 default gemset. This was resolved by adding gem 'bigdecimal' to my Gemfile.
<gem-root>/gems/activesupport-5.0.2/lib/active_support/core_ext/big_decimal/conversions.rb:2:in `require': cannot load such file -- bigdecimal/util (LoadError)
from <gem-root>/gems/activesupport-5.0.2/lib/active_support/core_ext/big_decimal/conversions.rb:2:in `<top (required)>'
from <gem-root>/gems/activesupport-5.0.2/lib/active_support/core_ext/object/json.rb:4:in `require'
from <gem-root>/gems/activesupport-5.0.2/lib/active_support/core_ext/object/json.rb:4:in `<top (required)>'
from <gem-root>/gems/activesupport-5.0.2/lib/active_support/core_ext/object.rb:11:in `require'
from <gem-root>/gems/activesupport-5.0.2/lib/active_support/core_ext/object.rb:11:in `<top (required)>'
from <gem-root>/gems/railties-5.0.2/lib/rails/configuration.rb:2:in `require'
from <gem-root>/gems/railties-5.0.2/lib/rails/configuration.rb:2:in `<top (required)>'
from <gem-root>/gems/railties-5.0.2/lib/rails/railtie/configuration.rb:1:in `require'
from <gem-root>/gems/railties-5.0.2/lib/rails/railtie/configuration.rb:1:in `<top (required)>'
from <gem-root>/gems/railties-5.0.2/lib/rails/railtie.rb:216:in `require'
from <gem-root>/gems/railties-5.0.2/lib/rails/railtie.rb:216:in `config'
from <gem-root>/gems/railties-5.0.2/lib/rails/railtie.rb:122:in `config'
from <gem-root>/gems/activesupport-5.0.2/lib/active_support/i18n_railtie.rb:7:in `<class:Railtie>'
from <gem-root>/gems/activesupport-5.0.2/lib/active_support/i18n_railtie.rb:6:in `<module:I18n>'
from <gem-root>/gems/activesupport-5.0.2/lib/active_support/i18n_railtie.rb:5:in `<top (required)>'
from <gem-root>/gems/activesupport-5.0.2/lib/active_support/railtie.rb:2:in `require'
from <gem-root>/gems/activesupport-5.0.2/lib/active_support/railtie.rb:2:in `<top (required)>'
from <gem-root>/gems/railties-5.0.2/lib/rails.rb:15:in `require'
from <gem-root>/gems/railties-5.0.2/lib/rails.rb:15:in `<top (required)>'
from <gem-root>/gems/railties-5.0.2/lib/rails/commands/server.rb:4:in `require'
from <gem-root>/gems/railties-5.0.2/lib/rails/commands/server.rb:4:in `<top (required)>'
from <gem-root>/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:138:in `require'
from <gem-root>/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:138:in `require_command!'
from <gem-root>/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:83:in `server'
from <gem-root>/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
from <gem-root>/gems/railties-5.0.2/lib/rails/commands.rb:18:in `<top (required)>'
from <rails-root>/bin/rails:9:in `require'
from <rails-root>/bin/rails:9:in `<top (required)>'
from <gem-root>/gems/spring-2.0.1/lib/spring/client/rails.rb:28:in `load'
from <gem-root>/gems/spring-2.0.1/lib/spring/client/rails.rb:28:in `call'
from <gem-root>/gems/spring-2.0.1/lib/spring/client/command.rb:7:in `call'
from <gem-root>/gems/spring-2.0.1/lib/spring/client.rb:30:in `run'
from <gem-root>/gems/spring-2.0.1/bin/spring:49:in `<top (required)>'
from <gem-root>/gems/spring-2.0.1/lib/spring/binstub.rb:31:in `load'
from <gem-root>/gems/spring-2.0.1/lib/spring/binstub.rb:31:in `<top (required)>'
from /Users/rpatterson/.rvm/rubies/ruby-2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/rpatterson/.rvm/rubies/ruby-2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from <rails-root>/bin/spring:15:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
I have same issue it seems.
I found this one, which might be relevant -- Difficulty with activesupport when attempting to deploy -- I've tried it but it did not worked for me. In my case 1.8 gems/tools got mingled with 1.9 so I've done more serious cleanup.
Check if you have multiple ruby installs by running which -a ruby and which -a rake and which -a rails. Tidy things up, so that you're using single ruby/bundler/rails combo. I've removed ruby 1.8 completely and left only 1.9 ruby on my system. Then I have cleaned all the gems in the system, and re-run the bundler. I am still missing something, because rake and rails continue to complain about bigdecimal/util

Resources