bcrypt LoadError with Rails - ruby-on-rails

I am having trouble finding a solution to this issue, and have tried many fixes others have ran into with no success. I am working on the Ruby on Rails 5 Tutorial by Michael Hartl which requires using bcrypt to implement the has_secure_password feature. When I run the test I get a long error message which starts with:
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bcrypt-3.1.11-x64-mingw32/lib/bcrypt.rb:16:in 'require': cannot load such file -- bcrypt_ext (LoadError)
I have attempted uninstalling and reinstalling bcrypt with adding --platform=ruby at the end and including various versions in the gemfile; gem 'bcrypt', '~> 3.1.7', 'bcrypt', '3.1.11', platforms: [:ruby, :x64_mingw], 'bcrypt', '~> 3.1.7', platforms: [:ruby] including various combinations of installing the gem file from the command line. Leaving the gemfile hashed out while installing from the console, uninstalling and running the Bundle Install with just the gemfile link.
This is the entire Error message I am receiving when trying to access the Rails Console:
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bcrypt-3.1.11-x64-mingw32/lib/bcrypt.rb:16:in 'require': cannot load such file -- bcrypt_ext (LoadError)
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bcrypt-3.1.11-x64-mingw32/lib/bcrypt.rb:16:in `rescue in <top (required)>'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bcrypt-3.1.11-x64-mingw32/lib/bcrypt.rb:12:in `<top (required)>'
from C:/Ruby23-x64/lib/ruby/site_ruby/2.3.0/bundler/runtime.rb:81:in `require'
from C:/Ruby23-x64/lib/ruby/site_ruby/2.3.0/bundler/runtime.rb:81:in `block (2 levels) in require'
from C:/Ruby23-x64/lib/ruby/site_ruby/2.3.0/bundler/runtime.rb:76:in `each'
from C:/Ruby23-x64/lib/ruby/site_ruby/2.3.0/bundler/runtime.rb:76:in `block in require'
from C:/Ruby23-x64/lib/ruby/site_ruby/2.3.0/bundler/runtime.rb:65:in `each'
from C:/Ruby23-x64/lib/ruby/site_ruby/2.3.0/bundler/runtime.rb:65:in `require'
from C:/Ruby23-x64/lib/ruby/site_ruby/2.3.0/bundler.rb:114:in `require'
from C:/Users/Bill/Documents/Sites/sample_app/config/application.rb:7:in `<top (required)>'
from C:/Ruby23x64/lib/ruby/gems/2.3.0/gems/railties-.1.4/lib/rails/command/actions.rb:15:in `require'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/command/actions.rb:15:in `require_application_and_environment!'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/commands/console/console_command.rb:96:in `perform'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.20.0/lib/thor/command.rb:27:in`run'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/command/base.rb:63:in `perform'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/command.rb:44:in `invoke'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/commands.rb:16:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
I am using Ruby version 2.3.3 with Rails version 5.1.4 running on Windows 7x64.
Any insight anyone could offer me at this point would be appreciated.
UPDATE
So after countless hours trying to solve the problem, using the gemfile:
gem 'bcrypt', git: 'https://github.com/codahale/bcrypt-ruby.git', :require => 'bcrypt'
was what solved the problem for me. This may not be a permanent solution, but at least it's letting me move forward!

There are more recent solutions you may want to explore, but when I had this problem several months ago with Rails 5.0, I used the accepted answer from this stack overflow question and it worked for me.
Update:
As suggested, I have added full answer in case link becomes dead.
First- Uninstall bcrypt
gem uninstall bcrypt-ruby
Then reinstall
gem install bcrypt --platform=ruby
Then in your Gemfile:
gem 'bcrypt','~>3.1.11' # Or current version

Related

WEBrick fails to start default rails app: "uninitialized constant ActiveRecord::ConnectionAdapters::Column::Format"

I'm trying to begin Ruby on Rails development on a Windows machine, but I can't get WEBrick to start the default Rails app.
Here's the output from my attempt to create and start the app:
C:\Users\my_user>ruby -v
ruby 2.2.4p230 (2015-12-16 revision 53155) [i386-mingw32]
C:\Users\my_user\Desktop\wkspc>rails new sample_app
[...]
Bundle complete! 11 Gemfile dependencies, 57 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
C:\Users\my_user\Desktop\wkspc>cd sample_app
C:\Users\my_user\Desktop\wkspc\sample_app>rails server
DEPRECATION WARNING: alias_method_chain is deprecated. Please, use Module#prepend instead. From module, you can access the original method using super. (called from require at bin/rails:4)
Bundler::GemRequireError: There was an error while trying to load the gem 'activerecord-jdbcsqlite3-adapter'.
Gem Load Error is: uninitialized constant ActiveRecord::ConnectionAdapters::Column::Format
Backtrace for gem load error is:
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc/jdbc/type_cast.rb:13:in `<module:TypeCast>'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc/jdbc/type_cast.rb:7:in `<module:Jdbc>'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc/jdbc/type_cast.rb:4:in `<module:ConnectionAdapters>'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc/jdbc/type_cast.rb:3:in `<top>'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc/jdbc/column.rb:1:in `singleton class'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc/jdbc/column.rb:70:in `<class:singleton class>'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc/jdbc/column.rb:68:in `<module:JdbcColumn>'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc/jdbc/column.rb:12:in `<module:ConnectionAdapters>'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc/jdbc/column.rb:2:in `<top>'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc/jdbc/column.rb:1:in `<top>'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc/jdbc/adapter.rb:1:in `require'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc/jdbc/adapter.rb:1:in `<module:(root)>'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc/jdbc/adapter.rb:9:in `<top>'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc/jdbc.rb:1:in `require'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc/jdbc.rb:1:in `<top>'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc/jdbc.rb:52:in `require'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc/jdbc.rb:52:in `<top>'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc/jdbc.rb:3:in `require'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc/jdbc.rb:3:in `block in (root)'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc.rb:1:in `each'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc.rb:1:in `block in (root)'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc.rb:9:in `each'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc.rb:9:in `(root)'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbcsqlite3-adapter-1.3.20/lib/activerecord-jdbcsqlite3-adapter.rb:1:in `(root)'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbcsqlite3-adapter-1.3.20/lib/activerecord-jdbcsqlite3-adapter.rb:2:in `<top>'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/bundler-1.12.5/lib/bundler/runtime.rb:1:in `require'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/bundler-1.12.5/lib/bundler/runtime.rb:1:in `block in (root)'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:in `tap'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:in `require'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in `require'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `<top>'
bin/rails:4:in `require'
bin/rails:4:in `<top>'
Bundler Error Backtrace:
block in require at C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/bundler-1.12.5/lib/bundler/runtime.rb:90
each at org/jruby/RubyArray.java:1593
block in require at C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/bundler-1.12.5/lib/bundler/runtime.rb:81
each at org/jruby/RubyArray.java:1593
require at C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/bundler-1.12.5/lib/bundler/runtime.rb:70
require at C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/bundler-1.12.5/lib/bundler.rb:102
<top> at C:/Users/my_user/Desktop/wkspc/sample_app/config/application.rb:7
require at org/jruby/RubyKernel.java:944
block in (root) at C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:1
tap at org/jruby/RubyKernel.java:1743
server at C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:88
server at C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:85
<top> at C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:49
require at org/jruby/RubyKernel.java:944
<top> at bin/rails:4
It appears as though the problem is coming from the gem 'activerecord-jdbcsqlite3-adapter', and the error indicates
uninitialized constant ActiveRecord::ConnectionAdapters::Column::Format
Have I skipped some important configuration step? Thanks for your help!
According to this issue, activerecord-jdbc-adapter is still having compatibility issues in Rails 5. There is a branch for rails-5 you can use by using this line in your Gemfile:
gem 'activerecord-jdbc-adapter', :git => "https://github.com/jruby/activerecord-jdbc-adapter.git",
:branch => "rails-5"
I ran into this issue while trying to use the target branch: 'rails-5 (which has been removed from the repo. I also was having compatibility issues when as well as using a specific version gem activerecord-jdbc-adapter "1.3.20"
The oldest tag that still supports rails v5.0.0.1 in the activerecord-jdbc-adapter repository is 50.1
I updated the following in my Gemfile:
gem 'activerecord-jdbc-adapter', '50.1'
gem 'activerecord-jdbcsqlite3-adapter', '50.1'

Rails Generate Controller gives me load error

I try to generate a controller but it gives me this error. I can't find where in my files what caused this error so help would be much appreciated. I am running Ruby '2.0.0' and rails '4.2.0.beta2' if that helps at all. PLEASE help! Thanks
I don't undestand WHY this post is getting marked as a duplicate. My question has nothing to do with that other question. Plus, I am asking what to do to fix it, and as far as I read, I didn't even see a fix to that error. PLEASE HELP!
c:\Users\NAME\workspace\sample_app>rails generate controller StaticPages home help
DL is deprecated, please use Fiddle
C:/Ruby200/lib/ruby/gems/2.0.0/gems/web-console-2.0.0.beta3/lib/web_console/slave.rb:1:in
`require': cannot load such file -- pty (LoadError)
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/web-console-2.0.0.beta3/lib/web_console/s
lave.rb:1:in `<top (required)>'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/web-console-2.0.0.beta3/lib/web_console.r
b:13:in `require'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/web-console-2.0.0.beta3/lib/web_console.r
b:13:in `<top (required)>'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/web-console-2.0.0.beta3/lib/web-console.r
b:1:in `require'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/web-console-2.0.0.beta3/lib/web-console.r
b:1:in `<top (required)>'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.7.3/lib/bundler/runtime.rb:76:i
n `require'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.7.3/lib/bundler.rb:133:in `requ
ire'
from c:/Users/Devin Miller/workspace/sample_app/config/application.rb:7:in `<top (
required)>'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.2.0.beta2/lib/rails/commands/c
ommands_tasks.rb:141:in `require'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.2.0.beta2/lib/rails/commands/c
ommands_tasks.rb:141:in `require_application_and_environment!'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.2.0.beta2/lib/rails/commands/c
ommands_tasks.rb:128:in `generate_or_destroy'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.2.0.beta2/lib/rails/commands/c
ommands_tasks.rb:50:in `generate'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.2.0.beta2/lib/rails/commands/c
ommands_tasks.rb:39:in `run_command!'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.2.0.beta2/lib/rails/commands.r
b:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
The problems is the Rails 4.2.0.beta depends on the pty gem and is unable to find it:
`require': cannot load such file -- pty
The reason is that the pty gem is not available on Windows. Hopefully that gets fixed before Rails 4.2 is released. At the moment you can fix this problem by removing the web-console gem from your Gemfile:
# Gemfile
# gem 'web-console'
Run bundle install after removing that gem.
To fix the problem that no source of timezone data could be found (TZinfo::DataSourceNotFound) please add the following line to your Gemfile:
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw]
And then try again:
bundle install
bundle exec rails generate controller StaticPages home help

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 3.2.0 rspec debugger not working

I've just upgraded to ruby 1.9.3-p0 and rails 3.2.0. I'm now trying to debug an error in one of my tests using
rspec spec -d
But I get this error:
/home/map7/.rvm/gems/ruby-1.9.3-p0#rails3.2/gems/rspec-core-2.8.0/lib/rspec/core/configuration.rb:422:in `rescue in debug=': (RuntimeError)
**************************************************
/home/map7/.rvm/gems/ruby-1.9.3-p0#rails3.2/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.so: undefined symbol: ruby_threadptr_data_type - /home/map7/.rvm/gems/ruby-1.9.3-p0#rails3.2/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.so
If you have it installed as a ruby gem, then you need to either require
'rubygems' or configure the RUBYOPT environment variable with the value
'rubygems'.
/home/map7/.rvm/gems/ruby-1.9.3-p0#rails3.2/gems/ruby-debug-base19-0.11.25/lib/ruby-debug-base.rb:1:in `require'
/home/map7/.rvm/gems/ruby-1.9.3-p0#rails3.2/gems/ruby-debug-base19-0.11.25/lib/ruby-debug-base.rb:1:in `<top (required)>'
/home/map7/.rvm/gems/ruby-1.9.3-p0#rails3.2/gems/ruby-debug19-0.11.6/cli/ruby-debug.rb:5:in `require'
/home/map7/.rvm/gems/ruby-1.9.3-p0#rails3.2/gems/ruby-debug19-0.11.6/cli/ruby-debug.rb:5:in `<top (required)>'
/home/map7/.rvm/gems/ruby-1.9.3-p0#rails3.2/gems/rspec-core-2.8.0/lib/rspec/core/configuration.rb:408:in `require'
/home/map7/.rvm/gems/ruby-1.9.3-p0#rails3.2/gems/rspec-core-2.8.0/lib/rspec/core/configuration.rb:408:in `debug='
/home/map7/.rvm/gems/ruby-1.9.3-p0#rails3.2/gems/rspec-core-2.8.0/lib/rspec/core/configuration_options.rb:19:in `block in configure'
/home/map7/.rvm/gems/ruby-1.9.3-p0#rails3.2/gems/rspec-core-2.8.0/lib/rspec/core/configuration_options.rb:18:in `each'
/home/map7/.rvm/gems/ruby-1.9.3-p0#rails3.2/gems/rspec-core-2.8.0/lib/rspec/core/configuration_options.rb:18:in `configure'
/home/map7/.rvm/gems/ruby-1.9.3-p0#rails3.2/gems/rspec-core-2.8.0/lib/rspec/core/command_line.rb:21:in `run'
/home/map7/.rvm/gems/ruby-1.9.3-p0#rails3.2/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:80:in `run_in_process'
/home/map7/.rvm/gems/ruby-1.9.3-p0#rails3.2/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:69:in `run'
/home/map7/.rvm/gems/ruby-1.9.3-p0#rails3.2/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:10:in `block in autorun'
**************************************************
from /home/map7/.rvm/gems/ruby-1.9.3-p0#rails3.2/gems/rspec-core-2.8.0/lib/rspec/core/configuration.rb:407:in `debug='
from /home/map7/.rvm/gems/ruby-1.9.3-p0#rails3.2/gems/rspec-core-2.8.0/lib/rspec/core/configuration_options.rb:19:in `block in configure'
from /home/map7/.rvm/gems/ruby-1.9.3-p0#rails3.2/gems/rspec-core-2.8.0/lib/rspec/core/configuration_options.rb:18:in `each'
from /home/map7/.rvm/gems/ruby-1.9.3-p0#rails3.2/gems/rspec-core-2.8.0/lib/rspec/core/configuration_options.rb:18:in `configure'
from /home/map7/.rvm/gems/ruby-1.9.3-p0#rails3.2/gems/rspec-core-2.8.0/lib/rspec/core/command_line.rb:21:in `run'
from /home/map7/.rvm/gems/ruby-1.9.3-p0#rails3.2/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:80:in `run_in_process'
from /home/map7/.rvm/gems/ruby-1.9.3-p0#rails3.2/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:69:in `run'
from /home/map7/.rvm/gems/ruby-1.9.3-p0#rails3.2/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:10:in `block in autorun'
Install the new debugger gem that works with Ruby 1.9.3 and 1.9.2:
https://github.com/cldwalker/debugger
Stick this in your Gemfile:
# one-liner to install these properly: bash < <(curl -L https://raw.github.com/gist/1333785)
gem 'linecache19', '0.5.13'
gem 'ruby-debug-base19', '0.11.26'
You'll need to run that one-liner in order for bundler to pick up the proper gems.
EDIT: I forgot to link to the posts I used to get debugging working:
ruby-debug with Ruby 1.9.3?
ruby-debug19 on ruby-1.9.3-preview1
I guess I can't comment on other answers yet, but I found many of these instructions don't mention you'll still need to include the
gem 'ruby-debug19', :require => 'ruby-debug'
line in your Gemfile, in addition to the instructions siannopollo provides. Without this, I get a 'cannot load such file -- ruby-debug' error (OSX, rvm, 1.9.3-p125).
FWIW, the gist is hardcoded to 1.9.3-p0, so if you're on 1.9.3-p125, you might need to edit it (also, generally a bad idea to execute a gist you haven't read).
For me, all it took was:
gem 'debugger'
in the Gemfile
Had to upgrade the following
bundle update ruby-debug-base19

problem installing webrick / mogrel or any other server for Rails 3

I have tried various installation methods for deploying a WEBrick and mongrel from the terminal. When I enter the rails server command I get the following:
Toran1$ rails server
/Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/mysql2-0.3.2/lib/mysql2.rb:8:in `require': dlopen(/Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/mysql2-0.3.2/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib (LoadError)
Referenced from: /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/mysql2-0.3.2/lib/mysql2/mysql2.bundle
Reason: image not found - /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/mysql2-0.3.2/lib/mysql2/mysql2.bundle
from /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/mysql2-0.3.2/lib/mysql2.rb:8:in `<top (required)>'
from /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.13/lib/bundler/runtime.rb:68:in `require'
from /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.13/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.13/lib/bundler/runtime.rb:66:in `each'
from /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.13/lib/bundler/runtime.rb:66:in `block in require'
from /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.13/lib/bundler/runtime.rb:55:in `each'
from /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.13/lib/bundler/runtime.rb:55:in `require'
from /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.13/lib/bundler.rb:120:in `require'
from /Users/Toran1/Sites/simple_cms/config/application.rb:7:in `<top (required)>'
from /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/railties-3.0.7/lib/rails/commands.rb:28:in `require'
from /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/railties-3.0.7/lib/rails/commands.rb:28:in `block in <top (required)>'
from /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/railties-3.0.7/lib/rails/commands.rb:27:in `tap'
from /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/railties-3.0.7/lib/rails/commands.rb:27:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I have installed the gem both locally and at the root level, and I also have navigated to the application folder before issuing the command. Any help would be appreciated!
Webrick will install automatically if you install rails in a correct manner.
Try this link
Here
And if you don't want to install rails again, try to install server using gem command
Dont forget to include the gems in Gemfile and to run "bundle install"
If you are using Rails < 3.1 you need to use version ~> 0.2.7 of the mysql2 gem
Checkout the documentation and search for active record: https://github.com/brianmario/mysql2
I'm not sure if that will help solve this problem directly, but it may solve others that you may encounter.
Just update your bundler, maybe of any-one of the older gem is conflicting with latest one, this type of issues arises.
gem install bundler
and then bundler install
If you find again error, then delete GEM.lock file, then run
bundler install
This may resolve the issue.

Resources