Ruby/Rails Debug in Aptana - rake not found - ruby-on-rails-3

I am really excited today because today I found an error which no one else has found in the history of the internet.
I am trying to learn how to use Aptana Studio 3 for debugging so in my application's root directory, I right click on config.ru and click on debug server and this is what is produced on the console:
List item
Fast Debugger (ruby-debug-ide 0.4.16, ruby-debug-base 0.11) listens on 127.0.0.1:50122
c:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs'
c:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:451:in `block in find_in_unresolved'
c:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:451:in `map'
c:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:451:in `find_in_unresolved'
c:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:43:in `require'
c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/dsl.rb:1:in `'
c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/definition.rb:17:in `build'
c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler.rb:138:in `definition'
c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler.rb:126:in `load'
c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler.rb:110:in `setup'
c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/setup.rb:17:in `'
c:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59:in `require'
c:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59:in `rescue in require'
c:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
C:/triton2/config/boot.rb:6:in `'
c:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
c:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
C:/triton2/script/rails:5:in `'
c:/Ruby192/lib/ruby/gems/1.9.1/gems/ruby-debug-ide-0.4.16/lib/ruby-debug-ide.rb:112:in `debug_load'
c:/Ruby192/lib/ruby/gems/1.9.1/gems/ruby-debug-ide-0.4.16/lib/ruby-debug-ide.rb:112:in `debug_program'
c:/Ruby192/lib/ruby/gems/1.9.1/gems/ruby-debug-ide-0.4.16/bin/rdebug-ide:87:in `'
c:/Ruby192/bin/rdebug-ide:19:in `load'
c:/Ruby192/bin/rdebug-ide:19:in `'
Uncaught exception: Could not find rake (>= 0.8.1) amongst []
Also, in the terminal I get this:
David#DAVID-PC /c/triton2
gem install rake
Successfully installed rake-0.9.2.2
1 gem installed
Installing ri documentation for rake-0.9.2.2...
Installing RDoc documentation for rake-0.9.2.2...

Related

Ruby On Rails server initiation errors

I have been following the tutorial on how to learn Ruby On Rails basics. I have installed the latest 2.2.3 version and ran "gem install rails". I have successfully created a new project, but I have got an error when tried to run a server with "rails server" command. I received these errors:
C:\Users\Kothas\Desktop\rubyonrails\myproject>rails server
c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sqlite3-1.3.10-x64-mingw32/lib/sqlite3.r:6:in `require': cannot load such file -- sqlite3/sqlite3_native (LoadError)
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sqlite3-1.3.10-x64-mingw32/ib/sqlite3.rb:6:in `rescue in <top (required)>'
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sqlite3-1.3.10-x64-mingw32/lib/sqlite3.rb:2:in `<top (required)>'
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/
untime.rb:76:in `require'
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/
untime.rb:76:in `block (2 levels) in require'
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/
untime.rb:72:in `each'
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/
untime.rb:72:in `block in require'
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/
untime.rb:61:in `each'
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/
untime.rb:61:in `require'
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler.
b:134:in `require'
from C:/Users/Kothas/Desktop/rubyonrails/myproject/config/application.r
:7:in `<top (required)>'
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.3/lib/rails/co
mands/commands_tasks.rb:78:in `require'
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.3/lib/rails/co
mands/commands_tasks.rb:78:in `block in server'
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.3/lib/rails/co
mands/commands_tasks.rb:75:in `tap'
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.3/lib/rails/co
mands/commands_tasks.rb:75:in `server'
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.3/lib/rails/co
mands/commands_tasks.rb:39:in `run_command!'
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.3/lib/rails/co
mands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
How can I fix these problems and start my application?
EDIT
I managed to fix sqlite3 errors, but the new ones showed
"cannot load such file -- nokogirl (LoadError)"
It looks like your application is having difficulty accessing your sqlite installation through the sqlite3 gem - try this answer: cannot load such file -- sqlite3/sqlite3_native (LoadError) on ruby on rails

Failing to do rails g bootstrap:install with 'twitter-bootstrap-rails'

It seems like I'm having the same issue as the person the OP for:
https://github.com/seyhunak/twitter-bootstrap-rails/issues/27
but I have not been able to fix it.
Doing a basic rails app like described in:
http://railscasts.com/episodes/328-twitter-bootstrap-basics
fails with trying to rails g bootstrap:install.
The base versions of r/r on my system are:
ruby v 1.9.2p320,
rails 3.1.0
on snow leopard 10.6.4
The way I can replicate on my local system:
rails new bsapp --skip-stylesheets
cd bsapp
rails g scaffold product name:string price:decimal --skip-stylesheets
add gem 'twitter-bootstrap-rails' to the assets group in gemfile.
bundle update
rails g bootstrap:install
This is where the problem is.
Hayk-Saakians-Mac:bsapp hayk$ rails g bootstrap:install
/Users/hayk/.rvm/gems/ruby-1.9.2-p320/gems/less-2.2.1/lib/less/java_script/v8_context.rb:61:in `rescue in lock': uninitialized constant V8::JSError (NameError)
from /Users/hayk/.rvm/gems/ruby-1.9.2-p320/gems/less-2.2.1/lib/less/java_script/v8_context.rb:60:in `lock'
from /Users/hayk/.rvm/gems/ruby-1.9.2-p320/gems/less-2.2.1/lib/less/java_script/v8_context.rb:19:in `initialize'
from /Users/hayk/.rvm/gems/ruby-1.9.2-p320/gems/less-2.2.1/lib/less/java_script/v8_context.rb:15:in `new'
from /Users/hayk/.rvm/gems/ruby-1.9.2-p320/gems/less-2.2.1/lib/less/java_script/v8_context.rb:15:in `instance'
from /Users/hayk/.rvm/gems/ruby-1.9.2-p320/gems/less-2.2.1/lib/less/loader.rb:10:in `initialize'
from /Users/hayk/.rvm/gems/ruby-1.9.2-p320/gems/less-2.2.1/lib/less.rb:14:in `new'
from /Users/hayk/.rvm/gems/ruby-1.9.2-p320/gems/less-2.2.1/lib/less.rb:14:in `<module:Less>'
from /Users/hayk/.rvm/gems/ruby-1.9.2-p320/gems/less-2.2.1/lib/less.rb:9:in `<top (required)>'
from /Users/hayk/.rvm/gems/ruby-1.9.2-p320/gems/less-rails-2.2.3/lib/less/rails.rb:6:in `require'
from /Users/hayk/.rvm/gems/ruby-1.9.2-p320/gems/less-rails-2.2.3/lib/less/rails.rb:6:in `<top (required)>'
from /Users/hayk/.rvm/gems/ruby-1.9.2-p320/gems/less-rails-2.2.3/lib/less-rails.rb:1:in `require'
from /Users/hayk/.rvm/gems/ruby-1.9.2-p320/gems/less-rails-2.2.3/lib/less-rails.rb:1:in `<top (required)>'
from /Users/hayk/.rvm/gems/ruby-1.9.2-p320/gems/twitter-bootstrap-rails-2.1.3/lib/twitter-bootstrap-rails.rb:9:in `require'
from /Users/hayk/.rvm/gems/ruby-1.9.2-p320/gems/twitter-bootstrap-rails-2.1.3/lib/twitter-bootstrap-rails.rb:9:in `<top (required)>'
from /Users/hayk/.rvm/gems/ruby-1.9.2-p320#global/gems/bundler-1.2.0/lib/bundler/runtime.rb:68:in `require'
from /Users/hayk/.rvm/gems/ruby-1.9.2-p320#global/gems/bundler-1.2.0/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from /Users/hayk/.rvm/gems/ruby-1.9.2-p320#global/gems/bundler-1.2.0/lib/bundler/runtime.rb:66:in `each'
from /Users/hayk/.rvm/gems/ruby-1.9.2-p320#global/gems/bundler-1.2.0/lib/bundler/runtime.rb:66:in `block in require'
from /Users/hayk/.rvm/gems/ruby-1.9.2-p320#global/gems/bundler-1.2.0/lib/bundler/runtime.rb:55:in `each'
from /Users/hayk/.rvm/gems/ruby-1.9.2-p320#global/gems/bundler-1.2.0/lib/bundler/runtime.rb:55:in `require'
from /Users/hayk/.rvm/gems/ruby-1.9.2-p320#global/gems/bundler-1.2.0/lib/bundler.rb:128:in `require'
from /Users/hayk/ror/bsapp/config/application.rb:7:in `<top (required)>'
from /Users/hayk/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.1.0/lib/rails/commands.rb:21:in `require'
from /Users/hayk/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.1.0/lib/rails/commands.rb:21:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Hayk-Saakians-Mac:bsapp hayk$
full source: http://pastebin.com/nXBcq2bB
The root of the problem was a bad/old/nonexistent installation of v8/therubyracer/libv8
Certain versions of the libv8 gem just straight up failed to install, and the ones that did -- they took several hours, so I assumed they were hanging/crashing (I am working with a netbook, so that could be expected).
At the moment, the following configuration works for me:
gem "libv8", "3.11.8.13"
gem "therubyracer", :require => 'v8'
gem "less-rails"
gem "twitter-bootstrap-rails"
in development, and in production (heroku)
There was a github issue on either rubyracer or libv8 related to this that mentioned issues with x86/32bit processors -- i don't remember it offhand.

Cap generates "cannot load such file -- Bundler/capistrano (LoadError)"

I am developing a RoR application on two different machines. The iMac works fine, and all Capistrano tasks work as expected. The macbook-pro, however, generates the following error for any cap task (even "cap -T")
luna:shootingstars sjf$ cap -T
/Users/sjf/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- Bundler/capistrano (LoadError)
from /Users/sjf/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/configuration/loading.rb:152:in `require'
from ./config/deploy.rb:30:in `load'
from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/configuration/loading.rb:93:in `instance_eval'
from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/configuration/loading.rb:93:in `load'
from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/configuration/loading.rb:172:in `load_from_file'
from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/configuration/loading.rb:89:in `load'
from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/configuration/loading.rb:86:in `block in load'
from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/configuration/loading.rb:86:in `each'
from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/configuration/loading.rb:86:in `load'
from Capfile:8:in `load'
from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/configuration/loading.rb:93:in `instance_eval'
from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/configuration/loading.rb:93:in `load'
from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/configuration/loading.rb:172:in `load_from_file'
from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/configuration/loading.rb:89:in `load'
from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/configuration/loading.rb:86:in `block in load'
from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/configuration/loading.rb:86:in `each'
from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/configuration/loading.rb:86:in `load'
from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/cli/execute.rb:65:in `block in load_recipes'
from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/cli/execute.rb:65:in `each'
from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/cli/execute.rb:65:in `load_recipes'
from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/cli/execute.rb:31:in `execute!'
from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/cli/execute.rb:14:in `execute'
from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/bin/cap:4:in `<top (required)>'
from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/bin/cap:19:in `load'
from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/bin/cap:19:in `<main>'
As near as I can tell, everything is set up the same on the two machines. The only difference I can find is that on the working machine...
sol:shootingstars sjf$ gem which bundler
/Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.0.21/lib/bundler.rb
while on the failing machine...
luna:shootingstars sjf$ gem which bundler
/Users/sjf/.rvm/gems/ruby-1.9.3-p0#global/gems/bundler-1.0.21/lib/bundler.rb
Note the "#global" in the ruby path.
Other than that, both machines are running
rvm version 1.10.2
ruby version 1.9.3p0
bundle version 1.0.21
capistrano version 2.9.0
rails version 3.2.1
Thanks for any help
Well, I finally figured out the answer to my own question. Turns out the Macbook Pro with the problem had "case sensitivity" turned on in the filesystem. "Mac OS Extended (Case-sensitive, Journaled)"
Changing the deploy.rb file line from...
require "Bundler/capistrano"
to
require "bundler/capistrano"
fixed the problem! (Yay!)

undefined local variable or method `index' for #<Bundler::Definition

Every thing was working fine and once I logout and login back to my system, nothing works for Rails 3.1 on my system. On every app it throws the same error:
/home/nazar2/.rvm/gems/ruby-1.9.2-p290#rails3.1/gems/bundler-1.0.21/lib/bundler/definition.rb:151:in `resolve': undefined local variable or method `index' for #<Bundler::Definition:0x97a48d4> (NameError)
from /home/nazar2/.rvm/gems/ruby-1.9.2-p290#rails3.1/gems/bundler-1.0.21/lib/bundler/definition.rb:90:in `specs'
from /home/nazar2/.rvm/gems/ruby-1.9.2-p290#rails3.1/gems/bundler-1.0.21/lib/bundler/definition.rb:135:in `specs_for'
from /home/nazar2/.rvm/gems/ruby-1.9.2-p290#rails3.1/gems/bundler-1.0.21/lib/bundler/definition.rb:124:in `requested_specs'
from /home/nazar2/.rvm/gems/ruby-1.9.2-p290#rails3.1/gems/bundler-1.0.21/lib/bundler/environment.rb:23:in `requested_specs'
from /home/nazar2/.rvm/gems/ruby-1.9.2-p290#rails3.1/gems/bundler-1.0.21/lib/bundler/runtime.rb:11:in `setup'
from /home/nazar2/.rvm/gems/ruby-1.9.2-p290#rails3.1/gems/bundler-1.0.21/lib/bundler.rb:110:in `setup'
from /home/nazar2/.rvm/gems/ruby-1.9.2-p290#rails3.1/gems/bundler-1.0.21/lib/bundler/setup.rb:7:in `<top (required)>'
from /home/nazar2/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59:in `require'
from /home/nazar2/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59:in `rescue in require'
from /home/nazar2/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
from /home/backup/Hub/clients/orthomind/new/orthomind/config/boot.rb:6:in `<top (required)>'
from <internal:lib/rubygems/custom_require>:29:in `require'
from <internal:lib/rubygems/custom_require>:29:in `require'
from script/rails:5:in `<main>'
I am stuck and can't figure out what the issue is.
Just updated to bundler gem and every things works perfectly fine.
gem install bundler --pre
I think there was some issue with previous bundler gem version with Rails3.1

refinery-edge gives error "no such file to load -- refinerycms-base (LoadError)"

I'm trying to run refinery-edge on my Ubuntu 10.04 64bit. I have RVM installed, created the gemset "refinery-edge", and followed the steps in the refinery website, but when I try to create the refinery project I get the following error:
<internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- refinerycms-base (LoadError)
from <internal:lib/rubygems/custom_require>:29:in `require'
from /home/felixmm/Desktop/Rails_Projects/refinerycms-edge/lib/refinerycms.rb:2:in `block in <top (required)>'
from /home/felixmm/Desktop/Rails_Projects/refinerycms-edge/lib/refinerycms.rb:1:in `each'
from /home/felixmm/Desktop/Rails_Projects/refinerycms-edge/lib/refinerycms.rb:1:in `<top (required)>'
from <internal:lib/rubygems/custom_require>:29:in `require'
from <internal:lib/rubygems/custom_require>:29:in `require'
from /home/felixmm/Desktop/Rails_Projects/refinerycms-edge/lib/refinery.rb:3:in `<top (required)>'
from <internal:lib/rubygems/custom_require>:29:in `require'
from <internal:lib/rubygems/custom_require>:29:in `require'
from refinerycms-edge/bin/refinerycms:15:in `<main>'
Any help on this? thanks.
I've removed the guide as that was really for pre-0.9.9 and was asking for feedback via GitHub, please use the gem instead.
Currently the gem is up to date with edge.
Thanks