rails generate scaffold User name:string email:string - ruby-on-rails

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.

Related

Cannot run migrations on Rails

I believe I have an environment setup issue here, which I cannot seem to figure out. Trying to generate a migration in order to set up my Users table, but keep receiving the following message.
gem pristine --all
Sunnys-MBP:Vine SunnyPatel$ rails generate migration Users
/Users/SunnyPatel/.rvm/gems/ruby-2.5.1/gems/msgpack-1.3.1/lib/msgpack.rb:11:in `require': incompatible library version - /Users/SunnyPatel/.rvm/gems/ruby-2.5.1/gems/msgpack-1.3.1/lib/msgpack/msgpack.bundle (LoadError)
from /Users/SunnyPatel/.rvm/gems/ruby-2.5.1/gems/msgpack-1.3.1/lib/msgpack.rb:11:in `rescue in <top (required)>'
from /Users/SunnyPatel/.rvm/gems/ruby-2.5.1/gems/msgpack-1.3.1/lib/msgpack.rb:8:in `<top (required)>'
from /Users/SunnyPatel/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/store.rb:3:in `require'
from /Users/SunnyPatel/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/store.rb:3:in `block in <top (required)>'
from /Users/SunnyPatel/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.4.5/lib/bootsnap/explicit_require.rb:43:in `rescue in with_gems'
from /Users/SunnyPatel/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.4.5/lib/bootsnap/explicit_require.rb:39:in `with_gems'
from /Users/SunnyPatel/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/store.rb:3:in `<top (required)>'
from /Users/SunnyPatel/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache.rb:74:in `require_relative'
from /Users/SunnyPatel/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache.rb:74:in `<top (required)>'
from /Users/SunnyPatel/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.4.5/lib/bootsnap.rb:3:in `require_relative'
from /Users/SunnyPatel/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.4.5/lib/bootsnap.rb:3:in `<top (required)>'
from /Users/SunnyPatel/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.4.5/lib/bootsnap/setup.rb:1:in `require_relative'
from /Users/SunnyPatel/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.4.5/lib/bootsnap/setup.rb:1:in `<top (required)>'
from /Users/SunnyPatel/Desktop/Vine/config/boot.rb:4:in `require'
from /Users/SunnyPatel/Desktop/Vine/config/boot.rb:4:in `<top (required)>'
from /Users/SunnyPatel/Desktop/Vine/config/application.rb:1:in `require_relative'
from /Users/SunnyPatel/Desktop/Vine/config/application.rb:1:in `<top (required)>'
from /Users/SunnyPatel/.rvm/gems/ruby-2.5.1/gems/spring-2.1.0/lib/spring/application.rb:92:in `require'
from /Users/SunnyPatel/.rvm/gems/ruby-2.5.1/gems/spring-2.1.0/lib/spring/application.rb:92:in `preload'
from /Users/SunnyPatel/.rvm/gems/ruby-2.5.1/gems/spring-2.1.0/lib/spring/application.rb:157:in `serve'
from /Users/SunnyPatel/.rvm/gems/ruby-2.5.1/gems/spring-2.1.0/lib/spring/application.rb:145:in `block in run'
from /Users/SunnyPatel/.rvm/gems/ruby-2.5.1/gems/spring-2.1.0/lib/spring/application.rb:139:in `loop'
from /Users/SunnyPatel/.rvm/gems/ruby-2.5.1/gems/spring-2.1.0/lib/spring/application.rb:139:in `run'
from /Users/SunnyPatel/.rvm/gems/ruby-2.5.1/gems/spring-2.1.0/lib/spring/application/boot.rb:19:in `<top (required)>'
from /Users/SunnyPatel/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
from /Users/SunnyPatel/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
from -e:1:in `<main>'
This is likely due to the fact that the system version of ruby is different to the version for your application.
Try appending bundle exec to your command.
bundle exec rails generate migration Users
Also, it's not likely that your command will work. You want to create a new User model? Then you want this command instead:
bundle exec rails generate model User

Rails db:migrate error

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.

ruby-on-rails server crashes with 'incompatible library version'

I have a new installation of ruby on rails on a recently updated mac, with the most recent version of ruby installed on it. I created my first new rails application, with the command:rails new blog
The app was created without any error messages. However, when I move into the new directory and run bin/rails server the server build fails with a long list of error messages:
/Users/antony1/.rvm/gems/ruby-2.3.0/gems/debug_inspector-0.0.2/lib/debug_inspector.rb:6:in `require': incompatible library version - /Users/antony1/.rvm/gems/ruby-2.3.0/gems/debug_inspector-0.0.2/lib/debug_inspector.bundle (fatal)
from /Users/antony1/.rvm/gems/ruby-2.3.0/gems/debug_inspector-0.0.2/lib/debug_inspector.rb:6:in `<top (required)>'
from /Users/antony1/.rvm/gems/ruby-2.3.0/gems/binding_of_caller-0.7.2/lib/binding_of_caller/mri2.rb:1:in `require'
from /Users/antony1/.rvm/gems/ruby-2.3.0/gems/binding_of_caller-0.7.2/lib/binding_of_caller/mri2.rb:1:in `<top (required)>'
from /Users/antony1/.rvm/gems/ruby-2.3.0/gems/binding_of_caller-0.7.2/lib/binding_of_caller.rb:9:in `require'
from /Users/antony1/.rvm/gems/ruby-2.3.0/gems/binding_of_caller-0.7.2/lib/binding_of_caller.rb:9:in `<top (required)>'
from /Users/antony1/.rvm/gems/ruby-2.3.0/gems/web-console-2.3.0/lib/web_console.rb:1:in `require'
from /Users/antony1/.rvm/gems/ruby-2.3.0/gems/web-console-2.3.0/lib/web_console.rb:1:in `<top (required)>'
from /Users/antony1/.rvm/gems/ruby-2.3.0/gems/web-console-2.3.0/lib/web-console.rb:1:in `require'
from /Users/antony1/.rvm/gems/ruby-2.3.0/gems/web-console-2.3.0/lib/web-console.rb:1:in `<top (required)>'
from /Users/antony1/.rvm/gems/ruby-2.3.0#global/gems/bundler-1.11.2/lib/bundler/runtime.rb:77:in `require'
from /Users/antony1/.rvm/gems/ruby-2.3.0#global/gems/bundler-1.11.2/lib/bundler/runtime.rb:77:in `block (2 levels) in require'
from /Users/antony1/.rvm/gems/ruby-2.3.0#global/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `each'
from /Users/antony1/.rvm/gems/ruby-2.3.0#global/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `block in require'
from /Users/antony1/.rvm/gems/ruby-2.3.0#global/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `each'
from /Users/antony1/.rvm/gems/ruby-2.3.0#global/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `require'
from /Users/antony1/.rvm/gems/ruby-2.3.0#global/gems/bundler-1.11.2/lib/bundler.rb:99:in `require'
from /Users/antony1/Documents/Ruby/Rails/blog/config/application.rb:7:in `<top (required)>'
from /Users/antony1/.rvm/gems/ruby-2.3.0#global/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:78:in `require'
from /Users/antony1/.rvm/gems/ruby-2.3.0#global/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:78:in `block in server'
from /Users/antony1/.rvm/gems/ruby-2.3.0#global/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /Users/antony1/.rvm/gems/ruby-2.3.0#global/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:75:in `server'
from /Users/antony1/.rvm/gems/ruby-2.3.0#global/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /Users/antony1/.rvm/gems/ruby-2.3.0#global/gems/railties-4.2.5.1/lib/rails/commands.rb:17:in `<top (required)>'
from /Users/antony1/Documents/Ruby/Rails/blog/bin/rails:9:in `require'
from /Users/antony1/Documents/Ruby/Rails/blog/bin/rails:9:in `<top (required)>'
from /Users/antony1/.rvm/gems/ruby-2.3.0/gems/spring-1.6.2/lib/spring/client/rails.rb:28:in `load'
from /Users/antony1/.rvm/gems/ruby-2.3.0/gems/spring-1.6.2/lib/spring/client/rails.rb:28:in `call'
from /Users/antony1/.rvm/gems/ruby-2.3.0/gems/spring-1.6.2/lib/spring/client/command.rb:7:in `call'
from /Users/antony1/.rvm/gems/ruby-2.3.0/gems/spring-1.6.2/lib/spring/client.rb:28:in `run'
from /Users/antony1/.rvm/gems/ruby-2.3.0/gems/spring-1.6.2/bin/spring:49:in `<top (required)>'
from /Users/antony1/.rvm/gems/ruby-2.3.0/gems/spring-1.6.2/lib/spring/binstub.rb:11:in `load'
from /Users/antony1/.rvm/gems/ruby-2.3.0/gems/spring-1.6.2/lib/spring/binstub.rb:11:in `<top (required)>'
from /Users/antony1/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/antony1/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/antony1/Documents/Ruby/Rails/blog/bin/spring:13:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
I've run gem pristine --all and made sure that my gems were up to date, but I am still unable to get this to work. Any assistance would be appreciated.
After intializing a rails app, especially when you edit the Gemfile file, you need to run, it's generally a good idea to run bundle install to establish all the dependencies. Have you done that that?

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

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