rails: debug rails application in eclipse / aptana - ruby-on-rails

I can debug one of my old application. But when I create a new application. I tried to debug using eclipse / aptana. THe debugger didn't launch at all.
Gemfile for my old application
source 'http://rubygems.org'
gem 'rails', '4.0.0'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails'
gem 'coffee-rails'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
end
gem 'protected_attributes'
gem 'jquery-rails'
gem 'devise'
gem "less-rails"
gem "libv8" ,'3.16.14.3'
gem "therubyracer"
gem 'twitter-bootstrap-rails', "=2.2.6"
gem 'cancan'
gem 'rolify'
gem 'pusher'
gem 'pg'
gem 'public_activity'
gem 'rspec'
gem 'rspec-rails'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# To use Jbuilder templates for JSON
# gem 'jbuilder'
# Use unicorn as the app server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'debugger'
Gemfile for my new application
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'
group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', require: false
end
# Use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# Use unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano', group: :development
# Use debugger
# gem 'debugger', group: [:development, :test]
Something I might be missing?

Thanks for this post
Rails 4.0 project not starting through aptana studio 3
Create a folder script in the root of the app and place rails file from the bin folder to the script folder then it will work. You might need to change the web-server options in the aptana setting also.
I was having the same problem but this fix fixed it

Related

undefined local variable or method `acts_as_nested_set'

I am currently using Rails 4.2.5 for my project. In my gemfile, the way I install is :
gem 'awesome_nested_set'
Even though I install successfully, the problem is happened in the server.
Error:
undefined local variable or method `acts_as_nested_set'
only at production environment.
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.5'
# Use sqlite3 as the database for Active Record
gem 'mysql2', '0.3.18'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
#gem 'turbolinks'
gem 'awesome_nested_set', '3.0.2'
gem 'jquery-turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
gem 'bcrypt', '~> 3.1.7'
gem 'devise'
gem 'rails_admin'
gem 'rb-readline'
gem 'unicorn'
gem 'capistrano', '>= 3'
gem 'capistrano-bundler'
gem 'capistrano-rbenv', github: "capistrano/rbenv"
gem 'capistrano-rails'
gem 'omniauth'
gem 'omniauth-facebook'
gem 'omniauth-oauth2', '~> 1.3.1'
# Use Unicorn as the app server
# gem 'unicorn'
gem 'wicked'
gem 'kaminari'
gem "simple_calendar", "~> 2.0"
gem 'bootstrap-sass'
gem 'chosen-rails'
gem 'mailboxer'
gem 'webpay'
gem 'unicorn'
gem 'gretel'
gem 'sitemap_generator'
gem 'stripe'
gem 'carrierwave'
gem 'rmagick'
gem 'i18n_generators'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
gem 'pry-rails'
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
# gem 'spring'
end
[]# bundle show 'awesome_nested_set'
/usr/local/rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/awesome_nested_set-3.1.1
It's in there..!

Type Error with Active Admin - Ruby on Rails

I am new to Ruby on Rails(4.1.8) and using OS Windows 8, I have added the gem activeadmin in my gemfile and ran commands
rails g active_admin:install --skip-users
rake db:migrate
rails server
but I get the following exception while running http://localhost:3000/admin
TypeError: Object doesn't support this property or method (in
c:/Sites/CleverChalk/app/assets/javascripts/active_admin.js.coffee)
Could someone please advise why this occurs. i read a couple of post on
coffee-script-source and
coffee-rails but they have not worked for me.
My Gemfile is as below :
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.8'
# Use sqlite3 as the database for Active Record
#gem 'sqlite3'
gem 'pg'
gem 'activeadmin', github: 'activeadmin'
gem 'coffee-script-source', '1.8.0'
gem 'coffee-rails', '~> 4.0.0'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.3'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
# Use debugger
# gem 'debugger', group: [:development, :test]
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin]
I could resolve the issue by reinstalling activeadmin with Users that meant adding the devise gem as shown below:
gem 'devise'
to the gemfile and then
bundle install
rails generate devise:install
Thanks.

bundle install error because of therubyracer gem

I'm using rails 4.1.4 and ruby-2.1.1. My Gemfile :
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.4'
# Use mysql as the database for Active Record
gem 'mysql2'
gem 'devise'
gem "paperclip", "~> 4.2"
gem 'aws-sdk'
gem 'bootstrap-sass-rails'
gem 'bootstrap-datepicker-rails'
gem 'jquery-tokeninput-rails'
gem 'carmen-rails'
gem 'will_paginate'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.3'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
gem 'jquery-ui-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring', group: :development
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
# Use debugger
gem 'byebug'
# gem 'debugger', group: [:development, :test]
# group :production do
# gem "rails_12factor"
# gem "activerecord-postgresql-adapter"
# gem 'pg'
# end
gem 'activemerchant'
but whenever i run the bundle install command Rubymine said,
Gemfile:29: syntax error, unexpected ':', expecting $end
gem 'therubyracer', platforms: :ruby
what should i do? If i commented out the "therubyracer" gem. Then this error shows for sdoc gem.
Try this:
gem 'therubyracer', :platform => :ruby
As I see from your error traceback, you have Ruby 1.8 installed (OS default). Ruby on Rails 4.1 requires at least Ruby 1.9.3. So you can use RVM to install newer Ruby version. Then you'll be able to install all required gems. And using RVM or rbenv is recommended way to manage rubies nowadays.

Heroku states "Specified 'sqlite3' for database adapter"

Heroku states "Specified 'sqlite3' for database adapter, but the gem is not loaded. Add gem 'sqlite3' to your Gemfile" on the inital commit.
I've already changed my Gemfile so that sqlite is used in development and pg is used in production mode. My database.yml is added to the .gitignore file. Are there any places where I have to change sqlite to pg?
Thanks in advance
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.1'
gem 'activeadmin', github: 'gregbell/active_admin'
gem 'anjlab-bootstrap-rails', :require => 'bootstrap-rails',
:github => 'anjlab/bootstrap-rails',
:branch => '3.0.0'
gem "font-awesome-rails"
gem "json"
gem "nokogiri"
gem "leaflet-rails"
gem "mapbox-rails"
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'
group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', require: false
end
group :production, :staging do
gem 'pg'
gem 'rails_12factor'
end
group :development do
gem 'sqlite3'
gem 'better_errors'
gem "binding_of_caller"
end
# Use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.1.2'
# Use unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano', group: :development
# Use debugger
# gem 'debugger', group: [:development, :test]
I previously ran
bundle install --without production
the solution to my problem was to install also the production gems. What my production gems have to do with a "specified sqlite3 adapter" I don't understand at all.

bundle install rails error `parse': Illformed requirement [""] (Gem::Requirement::BadRequirementError)

ran bundle install
Unfortunately, a fatal error has occurred. Please see the Bundler troubleshooting documentation at http://bit.ly/bundler-issues. Thanks!
/Users/judyngai/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/requirement.rb:90:in `parse': Illformed requirement [""] (Gem::Requirement::BadRequirementError)
what is the problem with my bundler?
is working in a blank app but just not at the app that I am working on.
thank you
here is my gemfile as requested
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0'
#High Voltage
gem "high_voltage", "~> 1.2.4"
#Database
gem "pg", "~> 0.16.0"
#to make attribute accessible work
gem "protected_attributes", "~> 1.0.3"
#Authentication , upgrading devise?
gem "devise", "~> 3.0.3"
#Active Admin
gem 'activeadmin', github: 'gregbell/active_admin', branch: 'rails4'
#Simple Form
gem 'simple_form'
#js runting for bootstrap to work
gem "therubyracer"
#Web Server
gem "thin"
#Student Picture Uploaders
gem "rmagick"
gem "carrierwave"
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'
group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', require: false
end
# Use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# Use unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano', group: :development
# Use debugger
# gem 'debugger', group: [:development, :test]
I don't see any syntax errors in my gemfile. I remember seeing the same error before and removed an extra comma from my gemfile.

Resources