Debugging error in Rails app running on Webrick server - ruby-on-rails

I am running a Rails app on the webrick server and wanted to get error messages to be displayed to me in the console. I installed the debugger 'gem install debugger' and the installation went off without a glitch but when I restarted the server by typing in rails s --debugger, I got:
You need to install ruby-debug to run the server in debugging mode. With gems, use 'gem install ruby-debug'
Therefore I tried installing ruby-debug gem but I got the following error:
ERROR: Error installing ruby-debug:
ERROR: Failed to build gem native extension.
/Users/Me/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
Can't handle 1.9.x yet
* extconf.rb failed *
My query is: what is going wrong with the installation? Secondly, what would be the best way for me to get error messages to be displayed to me?

For sure I'm late but just for anyone stuck on this, I had the same problem and fixed it by adding "gem 'debugger'" to the gemfile and running bundle update

Related

Debug Ruby/Rails startup issue

Staring at an error like so:
Exiting
/Users/llcool/.rvm/gems/ruby-2.6.3/gems/actionpack-5.2.4.5/lib/action_dispatch/middleware/static.rb:111:in `initialize': wrong number of arguments (given 3, expected 2) (ArgumentError)
Where's my best starting point to figuring out what the issue is here? I've tried gem pristine and bundle install but the issue still persists. Some version conflict somewhere I assume.
UPDATE 1
After running some of the commands suggested I'm now getting this error :(
/Users/llcool/.rvm/gems/ruby-2.6.3/gems/bcrypt-3.1.16/lib/bcrypt.rb:12:in `require': incompatible library version - /Users/llcool/.rvm/gems/ruby-2.6.3/gems/bcrypt-3.1.16/lib/bcrypt_ext.bundle (LoadError)
UPDATE 2
Still having issues getting this app to load...
Fast Debugger (ruby-debug-ide 0.7.1.beta3, debase 0.2.5.beta2, file filtering is supported) listens on 0.0.0.0:55189
Uncaught exception: incompatible library version - /Users/llcool/.rvm/gems/ruby-2.6.3/gems/bcrypt-3.1.16/lib/bcrypt_ext.bundle
I've tried update, pristine, uninstall, reinstall, etc all with no luck.
When I have seen this before I delete the Gemfile.lock file, update gem and bundler:
gem update --system
And
bundle update --bundler
Then run bundle install again and see if that clears it up.

Capistrano deployment broken by new request for Capistrano-Harrow gem?

I thought my capistrano version was locked to 3.4.0, however it seems that it updated to 3.5. I tried going back to 3.4, but I keep getting the following message when I try to deploy my project to server.
DEBUG [72bb6fc3] An error occurred while installing capistrano-harrow (0.3.2), and Bundler cannot
continue.
Make sure that `gem install capistrano-harrow -v '0.3.2'` succeeds before
bundling.
I'm not familiar with capistrano-harrow, but read a little and doesn't seem like something I need. I did add to my gemfile in hopes of getting the deployment to send but even though that seemed to install fine, it still errors out for deployment. When I try executing gem install capistrano-harrow -v '0.3.2' - I get the following message and it doesn't install.
ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
bad response Not Found 404 (https://rubygems.global.ssl.fastly.net/quick/Marshal.4.8/capistrano-harrow-0.3.2.gemspec.rz)
Anyone know how I can either, opt out of harrow to try and get my deploy to work, or correct this issue to move forward? Thanks!
Update
I ran the following command to "opt-out", however, it still needs to build/install the gem I suppose which is currently the real issue.
git config harrow.disabled true
capistrano-harrow's 0.3.2 version seems to be yanked from Rubygems. There's a hint in the ERROR message you've pasted: Not Found 404 was received from the CDN.
If you're back on 3.4, the gem is not supposed to be in use but if you're running 3.5, please try to bundle update capistrano.

Rails App - with pg database - errors with setup

I am in rails setup hell.
I tried to make an app 2 years ago and after endless problems with it, I tried to make a fresh app and start again. I"m now having the same problem I had the first time around in getting the pg database setup, but none of the solutions offered for the first problem are working this time. My post about the problem the first time is here: Installing PG gem on OS X - failure to build native extension
Currently - I'm getting this error:
An error occurred while installing pg (0.18.4), and Bundler cannot continue.
Make sure that gem install pg -v '0.18.4' succeeds before bundling.
I have tried uninstalling and reinstalling pg. I have tried installing with home-brew. I have tried all of the suggestions in the previous post I wrote about this problem with my first app. I've tried the solutions in this post:
Ruby/PgSQL error on Rails start : cannot load such file -- pg_ext (LoadError)
Each time, the gem installs correctly. It's just I can't start the server or do anything from the command line - this error keeps coming up.
One of the steps I tried involved adding this to my command line. It's a straight copy & paste. I don't know what it means. I'm wondering if its a source of my issue:
export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/9.4/bin
When I try:
rake rails:update:bin
I get this error:
rake aborted!
LoadError: cannot load such file -- nokogiri/nokogiri
Does anyone know how to solve this problem? I'm in rails hell!
A similar issue is occur by a user. Please have look to this link. Hope this may helpful!!
Error message: Make sure that `gem install pg -v '0.18.1'` succeeds before bundling

Error while installing rails and starting server

I'm totally new to rails. I downloaded rails package from railsinstaller.org and installed it. While starting server, i got this error
"Could not find uglifier..."
Then i tried bundle install. It is not working.
Then i totally uninstalled it and installed only ruby from rubyinstaller.org. Ruby is working fine. When i tried "gem install rails", i'm getting this error
"could not download data from rubygems.org"
What i tried
1) I downloaded the rails-4.1.7.gem and tried installing it locally as show here
How can I specify a local gem in my Gemfile?
I tried gem "rails", :path => "D:\rails-4.1.7.gem"
Error: Unknown command rails
2) I tried the solution here
gem install rails doesn't work due to openssl/ETimedout in windows
But getting this exception
I cannot able to set it up. Please tell how to install rails and start the server. I'm a total newbie to rails.

Redmine installation - ruby rails 2.3.11 manual download

I am having a very hard time finding Rails 2.3.11 to download. I am trying to install this on Windows XP which Redmine 1.2.x requires this version. When I try to install the gem through the command prompt this is what I get:
C:\>gem install rails -v=2.3.11
ERROR: Could not find a valid gem 'rails' (=2.3.11) in any repository
ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
Errno::ETIMEOUT: A connection attempt failed because the connected party ddi not properly respond after a period of time, or established connection failed because connected host has failed to respond. - connect(2) (http://rubygems.org/latest_specs.4.8.gz)
I believe this problem is due to my highly secured internet connection. So I would like to manually download Rails 2.3.11. But I cannot find it. It seems it should be here: http://rubyforge.org/frs/?group_id=307 but the needed version 2.3.11 is not listed!
You are looking for http://rubygems.org/gems/rails/versions/2.3.11 ?
With manual installation you may get problems with dependecies (the needed gems must be loaded again manual when you use gem install xxx --local
Check this out
gem install -v=2.3.11 rails

Resources