Rails db:migrate error - ruby-on-rails

I've just installed ruby on rails after a tutorial on Windows so I can learn it, but this gives me headaches. I have this error when trying to migrate the db:
c:\row\dev\hello_world>rake db:migrate
rake aborted!
LoadError: cannot load such file -- sqlite3/sqlite3_native
c:/row/dev/hello_world/config/application.rb:7:in `<top (required)>'
c:/row/dev/hello_world/Rakefile:4:in `require_relative'
c:/row/dev/hello_world/Rakefile:4:in `<top (required)>'
LoadError: cannot load such file -- sqlite3/2.3/sqlite3_native
c:/row/dev/hello_world/config/application.rb:7:in `<top (required)>'
c:/row/dev/hello_world/Rakefile:4:in `require_relative'
c:/row/dev/hello_world/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)
c:\row\dev\hello_world>rails s
c:/row/Ruby23-x64/lib/ruby/gems/2.3.0/gems/sqlite3-1.3.11-x64-mingw32/lib/sqlite3.rb:6:in `require': cannot load such file -- sqlite3/sqlite3_native (LoadError)
from c:/row/Ruby23-x64/lib/ruby/gems/2.3.0/gems/sqlite3-1.3.11-x64-mingw32/lib/sqlite3.rb:6:in `rescue in <top (required)>'
from c:/row/Ruby23-x64/lib/ruby/gems/2.3.0/gems/sqlite3-1.3.11-x64-mingw32/lib/sqlite3.rb:2:in `<top (required)>'
from c:/row/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:in `require'
from c:/row/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:in `block (2 levels) in require'
from c:/row/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in `each'
from c:/row/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in `block in require'
from c:/row/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `each'
from c:/row/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `require'
from c:/row/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler.rb:102:in `require'
from c:/row/dev/hello_world/config/application.rb:7:in `<top (required)>'
from c:/row/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:88:in `require'
from c:/row/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:88:in `block in server'
from c:/row/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:85:in `tap'
from c:/row/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:85:in `server'
from c:/row/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
from c:/row/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.0.0/lib/rails/commands.rb:18:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
I was trying to run gem install sqlite3 in "row" directory, but after install nothing changed.

Related

I cannot run rails s because of Json gem

I was hopping to get some help because I can't run my project. I added an API to my rails project using serializer and Json, but the thing is when I run rails S I got this error on console. I already tried the following
Bundle
Bundle install
Rebuild all gems
Removing and adding Json file to Gem File
Removing all JSON entries from Gemfile.lock
.
home/leandro/.rvm/gems/ruby-2.2.1/gems/active_model_serializers-0.10.6/lib/active_model/serializer.rb:2:in `require': cannot load such file -- jsonapi/include_directive (LoadError)
from /home/leandro/.rvm/gems/ruby-2.2.1/gems/active_model_serializers-0.10.6/lib/active_model/serializer.rb:2:in `<top (required)>'
from /home/leandro/.rvm/gems/ruby-2.2.1/gems/active_model_serializers-0.10.6/lib/active_model_serializers.rb:50:in `require'
from /home/leandro/.rvm/gems/ruby-2.2.1/gems/active_model_serializers-0.10.6/lib/active_model_serializers.rb:50:in `<module:ActiveModelSerializers>'
from /home/leandro/.rvm/gems/ruby-2.2.1/gems/active_model_serializers-0.10.6/lib/active_model_serializers.rb:6:in `<top (required)>'
from /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:77:in `require'
from /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:77:in `block (2 levels) in require'
from /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:72:in `each'
from /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:72:in `block in require'
from /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:61:in `each'
from /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:61:in `require'
from /usr/lib/ruby/vendor_ruby/bundler.rb:99:in `require'
from /home/leandro/Documents/ruby/rails/bookstore/config/application.rb:7:in `<top (required)>'
from /home/leandro/.rvm/gems/ruby-2.2.1/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:78:in `require'
from /home/leandro/.rvm/gems/ruby-2.2.1/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:78:in `block in server'
from /home/leandro/.rvm/gems/ruby-2.2.1/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /home/leandro/.rvm/gems/ruby-2.2.1/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:75:in `server'
from /home/leandro/.rvm/gems/ruby-2.2.1/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /home/leandro/.rvm/gems/ruby-2.2.1/gems/railties-4.2.4/lib/rails/commands.rb:17:in `<top (required)>'
from /home/leandro/Documents/ruby/rails/bookstore/bin/rails:9:in `require'
from /home/leandro/Documents/ruby/rails/bookstore/bin/rails:9:in `<top (required)>'
from /home/leandro/.rvm/gems/ruby-2.2.1/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `load'
from /home/leandro/.rvm/gems/ruby-2.2.1/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `call'
from /home/leandro/.rvm/gems/ruby-2.2.1/gems/spring-2.0.2/lib/spring/client/command.rb:7:in `call'
from /home/leandro/.rvm/gems/ruby-2.2.1/gems/spring-2.0.2/lib/spring/client.rb:30:in `run'
from /home/leandro/.rvm/gems/ruby-2.2.1/gems/spring-2.0.2/bin/spring:49:in `<top (required)>'
from /home/leandro/.rvm/gems/ruby-2.2.1/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `load'
from /home/leandro/.rvm/gems/ruby-2.2.1/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `<top (required)>'
from /usr/local/lib/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from /usr/local/lib/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from /home/leandro/Documents/ruby/rails/bookstore/bin/spring:15:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
Thanks in advance for your help
Try to run bundle exec rails s

rails s says "brunch_watcher.rb:1:in `require': cannot load such file -- pty (LoadError)" in RailsInstaller

I installed breakfast in my rails project on Windows 10 PC. When I run rails s and it throw exception
D:/Development/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/breakfast-0.5.1/lib/breakfast/brunch_watcher.rb:1:in `require': cannot load such file -- pty (LoadError)
from D:/Development/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/breakfast-0.5.1/lib/breakfast/brunch_watcher.rb:1:in `<top (required)>'
from D:/Development/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/breakfast-0.5.1/lib/breakfast.rb:3:in `require'
from D:/Development/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/breakfast-0.5.1/lib/breakfast.rb:3:in `<top (required)>'
from D:/Development/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:91:in `require'
from D:/Development/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:91:in `block (2 levels) in require'
from D:/Development/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:86:in `each'
from D:/Development/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:86:in `block in require'
from D:/Development/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:75:in `each'
from D:/Development/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:75:in `require'
from D:/Development/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler.rb:106:in `require'
from D:/ProjectExt/confess_server/config/application.rb:7:in `<top (required)>'
from D:/Development/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:88:in `require'
from D:/Development/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:88:in `block in server'
from D:/Development/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:85:in `tap'
from D:/Development/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:85:in `server'
from D:/Development/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
from D:/Development/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands.rb:18:in `<top (required)>'
from bin/rails:9:in `require'

Ruby on rails server error with "rails s"

Everytime I input "rails s" into the command prompt I get this:
C:/Ruby21/lib/ruby/gems/2.1.0/gems/sqlite3-1.3.9-x86-mingw32/lib/sqlite3.rb:6:in `require': cannot load such file -- sql
ite3/sqlite3_native (LoadError)
from C:/Ruby21/lib/ruby/gems/2.1.0/gems/sqlite3-1.3.9-x86-mingw32/lib/sqlite3.rb:6:in `rescue in <top (required)>'
from C:/Ruby21/lib/ruby/gems/2.1.0/gems/sqlite3-1.3.9-x86-mingw32/lib/sqlite3.rb:2:in `<top (required)>'
from C:/Ruby21/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/lib/bundler/runtime.rb:76:in `require'
from C:/Ruby21/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from C:/Ruby21/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/lib/bundler/runtime.rb:72:in `each'
from C:/Ruby21/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/lib/bundler/runtime.rb:72:in `block in require'
from C:/Ruby21/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/lib/bundler/runtime.rb:61:in `each'
from C:/Ruby21/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/lib/bundler/runtime.rb:61:in `require'
from C:/Ruby21/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/lib/bundler.rb:133:in `require'
from C:/users/202378/desktop/hello_world/config/application.rb:7:in `<top (required)>'
from C:/Ruby21/lib/ruby/gems/2.1.0/gems/railties-4.1.6/lib/rails/commands/commands_tasks.rb:79:in `require'
from C:/Ruby21/lib/ruby/gems/2.1.0/gems/railties-4.1.6/lib/rails/commands/commands_tasks.rb:79:in `block in server'
from C:/Ruby21/lib/ruby/gems/2.1.0/gems/railties-4.1.6/lib/rails/commands/commands_tasks.rb:76:in `tap'
from C:/Ruby21/lib/ruby/gems/2.1.0/gems/railties-4.1.6/lib/rails/commands/commands_tasks.rb:76:in `server'
from C:/Ruby21/lib/ruby/gems/2.1.0/gems/railties-4.1.6/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
from C:/Ruby21/lib/ruby/gems/2.1.0/gems/railties-4.1.6/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
Any help? thanks
You are missing sqlite3/sqlite3_native. This is likely due to missing header or source files for sqlite3 in your win32 environment.

Cannot load nokogiri when installing rails_admin in rails 4.0.0

When trying to run rails g rails_admin:install I get the following error:
/home/vieirater/.rvm/gems/ruby-2.0.0-p247/gems/nokogiri-1.6.0/lib/nokogiri.rb:28:in `require': cannot load such file -- nokogiri/nokogiri (LoadError)
from /home/vieirater/.rvm/gems/ruby-2.0.0-p247/gems/nokogiri-1.6.0/lib/nokogiri.rb:28:in `<top (required)>'
from /home/vieirater/.rvm/gems/ruby-2.0.0-p247/gems/rack-pjax-0.7.0/lib/rack/pjax.rb:1:in `require'
from /home/vieirater/.rvm/gems/ruby-2.0.0-p247/gems/rack-pjax-0.7.0/lib/rack/pjax.rb:1:in `<top (required)>'
from /home/vieirater/.rvm/gems/ruby-2.0.0-p247/gems/rack-pjax-0.7.0/lib/rack-pjax.rb:2:in `require'
from /home/vieirater/.rvm/gems/ruby-2.0.0-p247/gems/rack-pjax-0.7.0/lib/rack-pjax.rb:2:in `<top (required)>'
from /home/vieirater/.rvm/gems/ruby-2.0.0-p247/gems/rails_admin-0.5.0/lib/rails_admin/engine.rb:7:in `require'
from /home/vieirater/.rvm/gems/ruby-2.0.0-p247/gems/rails_admin-0.5.0/lib/rails_admin/engine.rb:7:in `<top (required)>'
from /home/vieirater/.rvm/gems/ruby-2.0.0-p247/gems/rails_admin-0.5.0/lib/rails_admin.rb:1:in `require'
from /home/vieirater/.rvm/gems/ruby-2.0.0-p247/gems/rails_admin-0.5.0/lib/rails_admin.rb:1:in `<top (required)>'
from /home/vieirater/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
from /home/vieirater/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
from /home/vieirater/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
from /home/vieirater/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
from /home/vieirater/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
from /home/vieirater/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
from /home/vieirater/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
from /home/vieirater/website/config/application.rb:7:in `<top (required)>'
from /home/vieirater/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/commands.rb:44:in `require'
from /home/vieirater/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/commands.rb:44:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
You can try to run
rvm ruby-2.0.0-p247 gem update --system
More detail in this blog post on the very same issue.

Rake gets aborted with error: no such file to load -- openssl

I keep getting openssl issues on my Mac. I am completely perplexed by the error messages when I try to issue rails tasks. What might be the issue?
I definitely have openssl on my machine because when I type it in the terminal, it opens an openSSL> session.
Every time I try the following: RAILS_ENV=development rake db:migrate
I get the below error:
rake aborted!
no such file to load -- openssl
(See full trace by running task with --trace)
When I type the above with --trace option, it shows an error which is listed below.
When I try to launch rails server by typing rails s I get the below error:
$> rails s
/usr/local/rvm/gems/ruby-1.9.2-p320/gems/net-ssh-2.6.6/lib/net/ssh/transport/openssl.rb:2:in `require': no such file to load -- openssl (LoadError)
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/net-ssh-2.6.6/lib/net/ssh/transport/openssl.rb:2:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/net-ssh-2.6.6/lib/net/ssh/buffer.rb:2:in `require'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/net-ssh-2.6.6/lib/net/ssh/buffer.rb:2:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/net-ssh-2.6.6/lib/net/ssh/transport/algorithms.rb:1:in `require'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/net-ssh-2.6.6/lib/net/ssh/transport/algorithms.rb:1:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/net-ssh-2.6.6/lib/net/ssh/transport/session.rb:7:in `require'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/net-ssh-2.6.6/lib/net/ssh/transport/session.rb:7:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/net-ssh-2.6.6/lib/net/ssh.rb:10:in `require'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/net-ssh-2.6.6/lib/net/ssh.rb:10:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/net-ssh-gateway-1.2.0/lib/net/ssh/gateway.rb:2:in `require'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/net-ssh-gateway-1.2.0/lib/net/ssh/gateway.rb:2:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/capistrano-2.14.2/lib/capistrano/configuration/connections.rb:2:in `require'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/capistrano-2.14.2/lib/capistrano/configuration/connections.rb:2:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/capistrano-2.14.2/lib/capistrano/configuration.rb:5:in `require'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/capistrano-2.14.2/lib/capistrano/configuration.rb:5:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/capistrano-2.14.2/lib/capistrano.rb:3:in `require'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/capistrano-2.14.2/lib/capistrano.rb:3:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/bundler-1.3.4/lib/bundler/runtime.rb:72:in `require'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/bundler-1.3.4/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/bundler-1.3.4/lib/bundler/runtime.rb:70:in `each'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/bundler-1.3.4/lib/bundler/runtime.rb:70:in `block in require'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/bundler-1.3.4/lib/bundler/runtime.rb:59:in `each'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/bundler-1.3.4/lib/bundler/runtime.rb:59:in `require'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/bundler-1.3.4/lib/bundler.rb:132:in `require'
from /Users/imtiazahmad/scripts/xxx-patchtrack/config/application.rb:7:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.6/lib/rails/commands.rb:53:in `require'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.6/lib/rails/commands.rb:53:in `block in <top (required)>'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.6/lib/rails/commands.rb:50:in `tap'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.6/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Try rebuilding ruby with ssl support:
port install openssl +universal
rvm install 1.9.2 --with-openssl-dir=/opt/local

Resources