Aptana plugin Debug rails project - ruby-on-rails

I'm tring to debug a rails project using aptana studio 3 pluging
I've run the command
gem install ruby-debug-ide
When i select Debug Server of the contextual menu of the project i get:
/usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `require': /usr/local/rvm/gems/ruby-1.9.3-p194#miGemSet/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.so: undefined symbol: ruby_current_thread - /usr/local/rvm/gems/ruby-1.9.3-p194#miGemSet/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.so (LoadError)
from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
from /usr/local/rvm/gems/ruby-1.9.3-p194#miGemSet/gems/ruby-debug-base19-0.11.25/lib/ruby-debug-base.rb:1:in `<top (required)>'
from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `require'
from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
from /usr/local/rvm/gems/ruby-1.9.3-p194#miGemSet/gems/ruby-debug-ide-0.4.17.beta9/lib/ruby-debug-ide.rb:5:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.3-p194#miGemSet/gems/ruby-debug-ide-0.4.17.beta9/bin/rdebug-ide:17:in `require_relative'
from /usr/local/rvm/gems/ruby-1.9.3-p194#miGemSet/gems/ruby-debug-ide-0.4.17.beta9/bin/rdebug-ide:17:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.3-p194#miGemSet/bin/rdebug-ide:19:in `load'
from /usr/local/rvm/gems/ruby-1.9.3-p194#miGemSet/bin/rdebug-ide:19:in `<main>'
By the way my O.S is Fedora 16
Any of you knows what that means?
Thanks in advance.

I was having the same issue with Ubuntu 12.04, and did 2 things:
1- Sent an e-mail asking for help.
2- Install RubyMine
On both results the issue is some gems that are missing.
linecache19 (0.5.13 from http://rubyforge.org/frs/?group_id=8883&release_id=46302)
ruby-debug-base19x (gem install ruby-debug-base19x --pre)
ruby-debug-ide (gem install ruby-debug-ide --pre)
Thanks to Denis Usahkov for the help :D

I donwloaded the gems from the link above (http://rubyforge.org/frs/?group_id=8883&release_id=46302), then I did the following:
rvm fetch 1.9.3
gem install ~/Downloads/linecache19-0.5.13.gem
gem install ~/Downloads/ruby-debug-base19-0.11.26.gem -- --with-ruby-include=/home/bruno.medeiros/.rvm/src/ruby-1.9.3-p194/
The server started properly, but the Aptana don't stop on break points yet.

Related

My error when I setup rails with M1 and ruby 3.1.2?

I am trying to setup Rails and here is my problem.
My ruby version is 3.1.2(when I checked by command ruby -v)
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [arm64-darwin21]
But when I ran some codes like rails -v or rails -s, it always gave me this error
/Users/xxx/.gem/ruby/3.1.2/gems/bootsnap-1.14.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require': incompatible library version - /Users/anhbui/.gem/ruby/3.1.2/gems/bootsnap-1.14.0/lib/bootsnap/bootsnap.bundle (LoadError)
from /Users/xxx/.gem/ruby/3.1.2/gems/bootsnap-1.14.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
from /Users/xxx/.gem/ruby/3.1.2/gems/bootsnap-1.14.0/lib/bootsnap/compile_cache/iseq.rb:3:in `<top (required)>'
from /Users/xxx/.gem/ruby/3.1.2/gems/bootsnap-1.14.0/lib/bootsnap/compile_cache.rb:16:in `require_relative'
from /Users/xxx/.gem/ruby/3.1.2/gems/bootsnap-1.14.0/lib/bootsnap/compile_cache.rb:16:in `setup'
from /Users/xxx/.gem/ruby/3.1.2/gems/bootsnap-1.14.0/lib/bootsnap.rb:55:in `setup'
from /Users/xxx/.gem/ruby/3.1.2/gems/bootsnap-1.14.0/lib/bootsnap.rb:97:in `default_setup'
from /Users/xxx/.gem/ruby/3.1.2/gems/bootsnap-1.14.0/lib/bootsnap/setup.rb:5:in `<top (required)>'
from /Users/xxx/Desktop/Rails/freelancer/config/boot.rb:4:in `require'
from /Users/xxx/Desktop/Rails/freelancer/config/boot.rb:4:in `<top (required)>'
from bin/rails:3:in `require_relative'
from bin/rails:3:in `<main>'
So, how can I fix this one ?
My setup is
ruby 3.1.2
yarn 1.22.19
node 19.0.1
rails 6.1.x (maybe)
Thank you in advance!
Not sure what is the bug here but I faced the same issue and I solved it by completely uninstalling brew and reinstalling it back.
I got the suggestion from here: https://github.com/Shopify/bootsnap/issues/352

Ruby loading required items error

I'm trying to run the script from "HOW TO RUN YOUR OWN BITCOIN ARBITRAGE BOT".
You can try following it yourself and test the results.
I followed it exactly and yet, when I open the program, I get this and I have no idea how to fix it.
c:\Ruby200-x64\devkit>rbtc_simple
C:/Ruby200-x64/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require
': cannot load such file -- bundler (LoadError)
from C:/Ruby200-x64/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:5
5:in `require'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rbtc_arbitrage_simple-2.1.1
/lib/rbtc_arbitrage.rb:1:in `<top (required)>'
from C:/Ruby200-x64/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:5
5:in `require'
from C:/Ruby200-x64/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:5
5:in `require'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rbtc_arbitrage_simple-2.1.1
/bin/rbtc_simple:4:in `<top (required)>'
from C:/Ruby200-x64/bin/rbtc_simple:23:in `load'
from C:/Ruby200-x64/bin/rbtc_simple:23:in `<main>'
I'm running 64bit Ruby and 64bit devkit.
I ran git init in C:\Ruby200\bin, which I think is the right folder. How can I know where to run it?
You are missing the bundler gem as seen in your error message:
require: cannot load such file -- bundler
to fix this you can install bundler to your gems: gem install bundler

Rails console not working even after updates

I am trying to run rails console. I have tried everything suggested on SO. I have libreadline-6 installed. My ruby version is 2.1.1 and irb is 0.9.6.
/home/xamroc/.rbenv/versions/2.1.1/lib/ruby/2.1.0/irb/completion.rb:9:in `require': cannot load such file -- readline (LoadError)
from /home/xamroc/.rbenv/versions/2.1.1/lib/ruby/2.1.0/irb/completion.rb:9:in `<top (required)>'
from /home/xamroc/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/railties-4.0.3/lib/rails/commands/console.rb:3:in `require'
from /home/xamroc/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/railties-4.0.3/lib/rails/commands/console.rb:3:in `<top (required)>'
from /home/xamroc/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/railties-4.0.3/lib/rails/commands.rb:51:in `require'
from /home/xamroc/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/railties-4.0.3/lib/rails/commands.rb:51:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
Any suggestions?
Also, I am using rbenv to manage my ruby versions.
You need to install libreadline and also the -dev package and then you need to recompile ruby. When your using rvm you should always run
rvm requirements
first and then download and compile ruby. If your using rvm then you can run
rvm reinstall <version>
to do this.
// Also see: http://vvv.tobiassjosten.net/ruby/readline-in-ruby-with-rbenv/

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.

RubyMine errors after creating 'Rails application' project

I've downloaded and installed "rubyinstaller-1.9.2-p180.exe", then I installed gems(rubygems-1.6.2 by running 'ruby setup.rb') and the installed rails by running 'gem install rails'.
After doing all this, I've downloaded and installed RubyMine 3.1
In RubyMine I try to create new 'Rails Application' project, in the 'Rails application settings' dialog it shows above installed rub as the Ruby Interpreter, Rails Version says '3.0.5'. Rails Template is empty. 'Preconfigure for selected databases' is unchecked, and also "skip test:unit files' is unchecked.
After clicking ok, it creates some files at the top of the code there is a message "some of the required getms are note attached: sqlite3"( I didn't ask DB, so why sqlite??) anyway I click, on 'attach gems'.
After that I click on play icon, and get below errors. Please help me resolve this issues. Thanks in advance!
------------------------------
C:\Ruby192\bin\ruby.exe -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) C:/Users/kobi/RubymineProjects/deded/script/rails server -b 127.0.0.1 -p 3000 -e development
C:/Ruby192/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.3-x86-mingw32/lib/sqlite3.rb:6:in `require': no such file to load -- sqlite3/sqlite3_native (LoadError)
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.3-x86-mingw32/lib/sqlite3.rb:6:in `rescue in <top (required)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.3-x86-mingw32/lib/sqlite3.rb:2:in `<top (required)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/runtime.rb:68:in `require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/runtime.rb:66:in `each'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/runtime.rb:66:in `block in require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/runtime.rb:55:in `each'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/runtime.rb:55:in `require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler.rb:120:in `require'
from C:/Users/kobi/RubymineProjects/deded/config/application.rb:7:in `<top (required)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.5/lib/rails/commands.rb:28:in `require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.5/lib/rails/commands.rb:28:in `block in <top (required)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.5/lib/rails/commands.rb:27:in `tap'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.5/lib/rails/commands.rb:27:in `<top (required)>'
from C:/Users/kobi/RubymineProjects/deded/script/rails:6:in `require'
from C:/Users/kobi/RubymineProjects/deded/script/rails:6:in `<top (required)>'
from -e:1:in `load'
from -e:1:in `<main>'
Process finished with exit code 1
RubyInstaller for Ruby 1.9.2 doesn't support any other RubyGems version except the one which comes with the RubyInstaller. By updating RubyGems you break your Ruby installation. Please reinstall Ruby into the clean directory and don't update RubyGems.
Also, it looks like sqlite3.dll is missing from your PATH environment. Download it and unpack into RUBY_HOME\bin or c:\windows\system32. Rails needs some database and sqlite is the default.
Some native gem extensions may require DevKit installed, if you have problems installing such gems, install DevKit first.
Try this from console:
cd C:/users/kobi/rubymineprojects/deded
bundle install

Resources