I've got CSV files in the following format;
Category-1-GUID,Product1
,Product2
,Product3
Category-2-GUID,Product4
,Product5
and the task should write following data to the model:
Category-1-GUID,Product1
Category-1-GUID,Product2
Category-1-GUID,Product3
Category-2-GUID,Product4
Category-2-GUID,Product5
I've found Ruby on Rails - Import Data from a CSV file very useful to import the data but this little variance makes me became a blockhead....
Thanks in Advance! Best regards
-- EDIT 1: import_productdata.rake file: --
desc "Import Product with Category-GUID"
task :import_productdata do
require 'csv'
rows = CSV.read('tmp/export1.csv')
category_id = nil
items = rows.map do |row|
category_id = row[0] unless row[0].nil?
[category_id, row[1]]
end
csv = CSV.parse(items, :headers => false)
csv.each do |row|
Product.create!(row.to_hash)
end
end
Error:
** Invoke import_productdata (first_time)
** Execute import_productdata
/Users/bn/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/csv.rb:1326:in `ensure in parse': CSV#close at /Users/bn/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/forwardable.rb:156 forwarding to private method Array#close
rake aborted!
NoMethodError: undefined method `close' for #<Array:0x007fd69f43c3d0>
/Users/bn/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/forwardable.rb:226:in `close'
/Users/bn/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/csv.rb:1326:in `ensure in parse'
/Users/bn/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/csv.rb:1326:in `parse'
/Users/bn/Documents/RubyApps/TestApp/lib/tasks/import_productdata.rake:13:in `block in <top (required)>'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/task.rb:271:in `block in execute'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/task.rb:271:in `each'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/task.rb:271:in `execute'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/task.rb:213:in `block in invoke_with_call_chain'
/Users/bn/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/task.rb:193:in `invoke_with_call_chain'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/task.rb:182:in `invoke'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/application.rb:160:in `invoke_task'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/application.rb:116:in `each'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/application.rb:116:in `block in top_level'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/application.rb:125:in `run_with_threads'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/application.rb:110:in `top_level'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/application.rb:83:in `block in run'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/application.rb:186:in `standard_exception_handling'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/application.rb:80:in `run'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
/Users/bn/.rvm/gems/ruby-2.4.0/bin/rake:23:in `load'
/Users/bn/.rvm/gems/ruby-2.4.0/bin/rake:23:in `<main>'
Caused by:
NoMethodError: private method `gets' called for #<Array:0x007fd69f43c3d0>
/Users/bn/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/csv.rb:1830:in `block in shift'
/Users/bn/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/csv.rb:1828:in `loop'
/Users/bn/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/csv.rb:1828:in `shift'
/Users/bn/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/csv.rb:1770:in `each'
/Users/bn/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/csv.rb:1784:in `to_a'
/Users/bn/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/csv.rb:1784:in `read'
/Users/bn/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/csv.rb:1324:in `parse'
/Users/bn/Documents/RubyApps/TestApp/lib/tasks/import_productdata.rake:13:in `block in <top (required)>'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/task.rb:271:in `block in execute'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/task.rb:271:in `each'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/task.rb:271:in `execute'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/task.rb:213:in `block in invoke_with_call_chain'
/Users/bn/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/task.rb:193:in `invoke_with_call_chain'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/task.rb:182:in `invoke'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/application.rb:160:in `invoke_task'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/application.rb:116:in `each'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/application.rb:116:in `block in top_level'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/application.rb:125:in `run_with_threads'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/application.rb:110:in `top_level'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/application.rb:83:in `block in run'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/application.rb:186:in `standard_exception_handling'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/application.rb:80:in `run'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
/Users/bn/.rvm/gems/ruby-2.4.0/bin/rake:23:in `load'
/Users/bn/.rvm/gems/ruby-2.4.0/bin/rake:23:in `<main>'
Tasks: TOP => import_productdata
if you call just CSV.read then,
rows = CSV.read('test.csv')
Output is
[["Category-1-GUID", "Product1"], [nil, "Product2"], [nil, "Product3"], ["Category-2-GUID", "Product4"], [nil, "Product5"]]
So just putting category id to make category_id, product_id pair array.
require 'csv'
rows = CSV.read('test.csv')
category_id = nil
items = rows.map do |row|
category_id = row[0] unless row[0].nil?
[category_id, row[1]]
end
p items # [["Category-1-GUID", "Product1"], ["Category-1-GUID", "Product2"], ["Category-1-GUID", "Product3"], ["Category-2-GUID", "Product4"], ["Category-2-GUID", "Product5"]]
Related
I want to enumerate through the contents of a tar file in alphabetical order of the filenames contained in the tar file. The following dies with the error Error: closed Gem::Package::TarReader::Entry.
Gem::Package::TarReader.new io do |tar|
tar.sort_by{ |e| e.full_name }.each.map do |tar_entry|
file_contents = tar_entry.read
# more code here, not shown for clarity
file_contents
end
end
Here is the stack trace:
Liquid Exception: closed Gem::Package::TarReader::Entry in /var/sitesUbuntu/www.mslinn.com/_drafts/2020-09-28-using-aws-cloud9-with-jump-server.html
jekyll 3.8.7 | Error: closed Gem::Package::TarReader::Entry
/usr/lib/ruby/2.7.0/rubygems/package/tar_reader/entry.rb:30:in `check_closed': closed Gem::Package::TarReader::Entry (IOError)
from /usr/lib/ruby/2.7.0/rubygems/package/tar_reader/entry.rb:133:in `read'
from /var/sitesUbuntu/www.mslinn.com/_plugins/archive_display.rb:14:in `block (2 levels) in untar_contents'
from /var/sitesUbuntu/www.mslinn.com/_plugins/archive_display.rb:13:in `each'
from /var/sitesUbuntu/www.mslinn.com/_plugins/archive_display.rb:13:in `each'
from /var/sitesUbuntu/www.mslinn.com/_plugins/archive_display.rb:13:in `map'
from /var/sitesUbuntu/www.mslinn.com/_plugins/archive_display.rb:13:in `block in untar_contents'
from /usr/lib/ruby/2.7.0/rubygems/package/tar_reader.rb:29:in `new'
from /var/sitesUbuntu/www.mslinn.com/_plugins/archive_display.rb:12:in `untar_contents'
from /var/sitesUbuntu/www.mslinn.com/_plugins/archive_display.rb:25:in `block in render'
from /var/sitesUbuntu/www.mslinn.com/_plugins/archive_display.rb:24:in `open'
from /var/sitesUbuntu/www.mslinn.com/_plugins/archive_display.rb:24:in `render'
from /var/lib/gems/2.7.0/gems/liquid-4.0.3/lib/liquid/block_body.rb:103:in `render_node_to_output'
from /var/lib/gems/2.7.0/gems/liquid-4.0.3/lib/liquid/block_body.rb:91:in `render'
from /var/lib/gems/2.7.0/gems/liquid-4.0.3/lib/liquid/template.rb:208:in `block in render'
from /var/lib/gems/2.7.0/gems/liquid-4.0.3/lib/liquid/template.rb:242:in `with_profiling'
from /var/lib/gems/2.7.0/gems/liquid-4.0.3/lib/liquid/template.rb:207:in `render'
from /var/lib/gems/2.7.0/gems/liquid-4.0.3/lib/liquid/template.rb:220:in `render!'
from /var/lib/gems/2.7.0/gems/jekyll-3.8.7/lib/jekyll/liquid_renderer/file.rb:30:in `block (2 levels) in render!'
from /var/lib/gems/2.7.0/gems/jekyll-3.8.7/lib/jekyll/liquid_renderer/file.rb:42:in `measure_bytes'
from /var/lib/gems/2.7.0/gems/jekyll-3.8.7/lib/jekyll/liquid_renderer/file.rb:29:in `block in render!'
from /var/lib/gems/2.7.0/gems/jekyll-3.8.7/lib/jekyll/liquid_renderer/file.rb:49:in `measure_time'
from /var/lib/gems/2.7.0/gems/jekyll-3.8.7/lib/jekyll/liquid_renderer/file.rb:28:in `render!'
from /var/lib/gems/2.7.0/gems/jekyll-3.8.7/lib/jekyll/renderer.rb:126:in `render_liquid'
from /var/lib/gems/2.7.0/gems/jekyll-3.8.7/lib/jekyll/renderer.rb:79:in `render_document'
from /var/lib/gems/2.7.0/gems/jekyll-3.8.7/lib/jekyll/renderer.rb:62:in `run'
from /var/lib/gems/2.7.0/gems/jekyll-3.8.7/lib/jekyll/site.rb:479:in `render_regenerated'
from /var/lib/gems/2.7.0/gems/jekyll-3.8.7/lib/jekyll/site.rb:464:in `block (2 levels) in render_docs'
from /var/lib/gems/2.7.0/gems/jekyll-3.8.7/lib/jekyll/site.rb:463:in `each'
from /var/lib/gems/2.7.0/gems/jekyll-3.8.7/lib/jekyll/site.rb:463:in `block in render_docs'
from /var/lib/gems/2.7.0/gems/jekyll-3.8.7/lib/jekyll/site.rb:462:in `each_value'
from /var/lib/gems/2.7.0/gems/jekyll-3.8.7/lib/jekyll/site.rb:462:in `render_docs'
from /var/lib/gems/2.7.0/gems/jekyll-3.8.7/lib/jekyll/site.rb:191:in `render'
from /var/lib/gems/2.7.0/gems/jekyll-3.8.7/lib/jekyll/site.rb:71:in `process'
from /var/lib/gems/2.7.0/gems/jekyll-3.8.7/lib/jekyll/command.rb:28:in `process_site'
from /var/lib/gems/2.7.0/gems/jekyll-3.8.7/lib/jekyll/commands/build.rb:65:in `build'
from /var/lib/gems/2.7.0/gems/jekyll-3.8.7/lib/jekyll/commands/build.rb:36:in `process'
from /var/lib/gems/2.7.0/gems/jekyll-3.8.7/lib/jekyll/commands/serve.rb:93:in `block in start'
from /var/lib/gems/2.7.0/gems/jekyll-3.8.7/lib/jekyll/commands/serve.rb:93:in `each'
from /var/lib/gems/2.7.0/gems/jekyll-3.8.7/lib/jekyll/commands/serve.rb:93:in `start'
from /var/lib/gems/2.7.0/gems/jekyll-3.8.7/lib/jekyll/commands/serve.rb:75:in `block (2 levels) in init_with_program'
from /var/lib/gems/2.7.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute'
from /var/lib/gems/2.7.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each'
from /var/lib/gems/2.7.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute'
from /var/lib/gems/2.7.0/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
from /var/lib/gems/2.7.0/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
from /var/lib/gems/2.7.0/gems/jekyll-3.8.7/exe/jekyll:15:in `<top (required)>'
from /home/mslinn/gems/bin/jekyll:23:in `load'
from /home/mslinn/gems/bin/jekyll:23:in `<main>'
I just had to sort the result:
require 'rubygems/package'
File.open(tar_name, "rb") do |file|
Gem::Package::TarReader.new(file) do |tar|
return tar.each.map { |tar_entry|
if tar_entry.file?
file_contents = tar_entry.read.strip
"<div class='codeLabel'>#{tar_entry.full_name}</div><pre data-lt-active='false'>#{file_contents}</pre>"
else
""
end
}.sort_by{ |e| e.full_name }
end
end
Here is how I actually wrote the code in production:
def traverse_tar(tar_name)
require 'rubygems/package'
File.open(tar_name, "rb") do |file|
Gem::Package::TarReader.new(file) do |tar|
return tar.each.map { |entry|
if entry.file? then { :name => entry.full_name, :content => entry.read.strip } else nil end
}.compact.sort_by { |entry| entry[:name] }.map { |entry|
"<div class='codeLabel'>#{entry[:name]}</div><pre data-lt-active='false'>#{entry[:content]}</pre>"
}
end
end
end
I have migration 20150930051523_create_objects.rb:
class CreateObjects < ActiveRecord::Migration
def change
create_table :objects do |t|
t.text :name
t.timestamps null: false
end
Object.create :name => "A"
Object.create :name => "B"
Object.create :name => "C"
end
end
$ rake:db migrate --trace cause output:
** Invoke db:migrate (first_time)
** Invoke db:environment (first_time)
** Execute db:environment
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:migrate
== 20150930051523 CreateObjects: migrating ====================================
-- create_table(:objects)
-> 0.0010s
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
uninitialized constant CreateObjects::Object/db/migrate/20150930051523_create_objects.rb:8:in `change'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:605:in `exec_migration'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:589:in `block (2 levels) in migrate'
/usr/lib/ruby/2.1.0/benchmark.rb:279:in `measure'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:588:in `block in migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:292:in `with_connection'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:587:in `migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:765:in `migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:995:in `block in execute_migration_in_transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:1041:in `block in ddl_transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/abstract/transaction.rb:184:in `within_new_transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/transactions.rb:220:in `transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:1041:in `ddl_transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:994:in `execute_migration_in_transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:956:in `block in migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:952:in `each'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:952:in `migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:820:in `up'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:798:in `migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/tasks/database_tasks.rb:137:in `migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/railties/databases.rake:44:in `block (2 levels) in '
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `call'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `block in execute'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `each'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/usr/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:150:in `invoke_task'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `each'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `block in top_level'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:115:in `run_with_threads'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:100:in `top_level'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:78:in `block in run'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:176:in `standard_exception_handling'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:75:in `run'
/var/lib/gems/2.1.0/gems/rake-10.4.2/bin/rake:33:in `'
/usr/local/bin/rake:23:in `load'
/usr/local/bin/rake:23:in `'
NameError: uninitialized constant CreateObjects::Object/db/migrate/20150930051523_create_barbers.rb:8:in `change'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:605:in `exec_migration'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:589:in `block (2 levels) in migrate'
/usr/lib/ruby/2.1.0/benchmark.rb:279:in `measure'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:588:in `block in migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:292:in `with_connection'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:587:in `migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:765:in `migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:995:in `block in execute_migration_in_transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:1041:in `block in ddl_transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/abstract/transaction.rb:184:in `within_new_transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/transactions.rb:220:in `transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:1041:in `ddl_transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:994:in `execute_migration_in_transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:956:in `block in migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:952:in `each'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:952:in `migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:820:in `up'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:798:in `migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/tasks/database_tasks.rb:137:in `migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/railties/databases.rake:44:in `block (2 levels) in '
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `call'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `block in execute'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `each'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/usr/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:150:in `invoke_task'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `each'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `block in top_level'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:115:in `run_with_threads'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:100:in `top_level'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:78:in `block in run'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:176:in `standard_exception_handling'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:75:in `run'
/var/lib/gems/2.1.0/gems/rake-10.4.2/bin/rake:33:in `'
/usr/local/bin/rake:23:in `load'
/usr/local/bin/rake:23:in `'
Tasks: TOP => db:migrate
Error emerging at Object.create... stage, what is wrong?
Update: In a comment it was pointed out that the actual code was not containing "Object", this answer is thus based on the wrong example.
Object is a bad name to use for an (unscoped) Model class, as it is already defined by Ruby.
The Object you are calling create on is probably not the Object class you defined in your model sources.
I assume you run rails. Remove the Object.create lines from your migration. Run it, it should work fine. Then, call rails console, where you end up in a live session. Here you can play around with your code, e.g. call Object.create, Object.where{id: 1} etc. I assume that you will get the same errors.
So, as a solution, rename your Object into something else, like Class and look if it works.
Okay, that was a joke, of course Class is also a really bad name for a model class :) . Try to find something more meaningful.
The problem was solved by set up pg gem, which pull bundle of another gems and packs (particularly postgresql-server-dev-all). After installing it, the command rake db:migrate works fine and completely.
I have installed the gem 'aws-sdk-core' and in my model I have define
class abcd < Aws::Record::Base
ab = Pathname.new("#{Rails.root}/config/aws.yml")
cd = YAML::load(ERB.new(File.read(path)).result)
set_domain_name cd[Rails.env]['domain']
end
I am using this aws for running my rake tasks.so when am running my rake task its giving error :
NameError: uninitialized constant Aws::Record
/home/project/app/models/abcd.rb:1:in `<top (required)>'
/home/.rvm/gems/ruby-2.1.5/gems/railties-4.0.0/lib/rails/engine.rb:465:in `block (2 levels) in eager_load!'
/home/.rvm/gems/ruby-2.1.5/gems/railties-4.0.0/lib/rails/engine.rb:464:in `each'
/home/.rvm/gems/ruby-2.1.5/gems/railties-4.0.0/lib/rails/engine.rb:464:in `block in eager_load!'
/home/.rvm/gems/ruby-2.1.5/gems/railties-4.0.0/lib/rails/engine.rb:462:in `each'
/home/.rvm/gems/ruby-2.1.5/gems/railties-4.0.0/lib/rails/engine.rb:462:in `eager_load!'
/home/.rvm/gems/ruby-2.1.5/gems/railties-4.0.0/lib/rails/engine.rb:347:in `eager_load!'
/home/.rvm/gems/ruby-2.1.5/gems/railties-4.0.0/lib/rails/application/finisher.rb:56:in `each'
/home/.rvm/gems/ruby-2.1.5/gems/railties-4.0.0/lib/rails/application/finisher.rb:56:in `block in <module:Finisher>'
/home/.rvm/gems/ruby-2.1.5/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `instance_exec'
/home/.rvm/gems/ruby-2.1.5/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `run'
/home/.rvm/gems/ruby-2.1.5/gems/railties-4.0.0/lib/rails/initializable.rb:55:in `block in run_initializers'
/home/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:226:in `block in tsort_each'
/home/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
/home/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:427:in `each_strongly_connected_component_from'
/home/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:347:in `block in each_strongly_connected_component'
/home/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:345:in `each'
/home/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:345:in `call'
/home/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:345:in `each_strongly_connected_component'
/home/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:224:in `tsort_each'
/home/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:205:in `tsort_each'
/home/.rvm/gems/ruby-2.1.5/gems/railties-4.0.0/lib/rails/initializable.rb:54:in `run_initializers'
/home/.rvm/gems/ruby-2.1.5/gems/railties-4.0.0/lib/rails/application.rb:215:in `initialize!'
/home/.rvm/gems/ruby-2.1.5/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
/home/project/config/environment.rb:5:in `<top (required)>'
/home/.rvm/gems/ruby-2.1.5/gems/railties-4.0.0/lib/rails/application.rb:189:in `require_environment!'
/home/.rvm/gems/ruby-2.1.5/gems/railties-4.0.0/lib/rails/application.rb:249:in `block in run_tasks_blocks'
/home/.rvm/gems/ruby-2.1.5/gems/rake-10.4.2/lib/rake/task.rb:240:in `call'
/home/.rvm/gems/ruby-2.1.5/gems/rake-10.4.2/lib/rake/task.rb:240:in `block in execute'
/home/.rvm/gems/ruby-2.1.5/gems/rake-10.4.2/lib/rake/task.rb:235:in `each'
/home/.rvm/gems/ruby-2.1.5/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute'
/home/.rvm/gems/ruby-2.1.5/gems/rake-10.4.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/home/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
/home/.rvm/gems/ruby-2.1.5/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/home/.rvm/gems/ruby-2.1.5/gems/rake-10.4.2/lib/rake/task.rb:201:in `block in invoke_prerequisites'
/home/.rvm/gems/ruby-2.1.5/gems/rake-10.4.2/lib/rake/task.rb:199:in `each'
/home/.rvm/gems/ruby-2.1.5/gems/rake-10.4.2/lib/rake/task.rb:199:in `invoke_prerequisites'
/home/.rvm/gems/ruby-2.1.5/gems/rake-10.4.2/lib/rake/task.rb:178:in `block in invoke_with_call_chain'
/home/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
/home/.rvm/gems/ruby-2.1.5/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/home/.rvm/gems/ruby-2.1.5/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'
/home/.rvm/gems/ruby-2.1.5/gems/rake-10.4.2/lib/rake/application.rb:150:in `invoke_task'
/home/.rvm/gems/ruby-2.1.5/gems/rake-10.4.2/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/home/.rvm/gems/ruby-2.1.5/gems/rake-10.4.2/lib/rake/application.rb:106:in `each'
/home/.rvm/gems/ruby-2.1.5/gems/rake-10.4.2/lib/rake/application.rb:106:in `block in top_level'
/home/.rvm/gems/ruby-2.1.5/gems/rake-10.4.2/lib/rake/application.rb:115:in `run_with_threads'
/home/.rvm/gems/ruby-2.1.5/gems/rake-10.4.2/lib/rake/application.rb:100:in `top_level'
/home/.rvm/gems/ruby-2.1.5/gems/rake-10.4.2/lib/rake/application.rb:78:in `block in run'
/home/.rvm/gems/ruby-2.1.5/gems/rake-10.4.2/lib/rake/application.rb:176:in `standard_exception_handling'
/home/.rvm/gems/ruby-2.1.5/gems/rake-10.4.2/lib/rake/application.rb:75:in `run'
/home/.rvm/gems/ruby-2.1.5/gems/rake-10.4.2/bin/rake:33:in `<top (required)>'
/home/.rvm/gems/ruby-2.1.5/bin/rake:23:in `load'
/home/.rvm/gems/ruby-2.1.5/bin/rake:23:in `<main>'
/home/.rvm/gems/ruby-2.1.5/bin/ruby_executable_hooks:15:in `eval'
/home/.rvm/gems/ruby-2.1.5/bin/ruby_executable_hooks:15:in `<main>'
Please help me in finding the solution. Thank's in advance!!!
The v2 AWS SDK for Ruby does not included the AWS::Record abstraction from v1. You can continue using the v1 implementation for now, as both v1 and v2 gems can be used in the same application.
Yeah i just ran into this issue and resolved. It is because AWS updated their gem to 2.0. If you update the gem to 2.0 different configuration is required.
If you want to using the version you had before, just change the Gemfile like below:
Gemfile
gem 'aws-sdk', '< 2.0'
I'm trying to install Radiant CMS, but I having a problem trying to configure it with MySQL...
I follow the next tut , to install Radiant
https://github.com/radiant/radiant/wiki/Installing-on-Ubuntu
and then in the last step:
rake db:bootstrap
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/rails-2.3.18/lib/rails/gem_dependency.rb:21.
rake aborted!
**adapter:mysql database:dev_earth0 username:root password:dbpass host:localhost database is not configured**
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activerecord-2.3.18/lib/active_record/connection_adapters/abstract/connection_specification.rb:62:in `establish_connection'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activerecord-2.3.18/lib/active_record/connection_adapters/abstract/connection_specification.rb:60:in `establish_connection'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activerecord-2.3.18/lib/active_record/connection_adapters/abstract/connection_specification.rb:55:in `establish_connection'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rails-2.3.18/lib/initializer.rb:438:in `initialize_database'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rails-2.3.18/lib/initializer.rb:141:in `process'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rails-2.3.18/lib/initializer.rb:113:in `run'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/radiant-1.1.3/lib/radiant/initializer.rb:266:in `run'
/home/devdreams/domains/dreamsengineering.com/config/environment.rb:14:in `<top (required)>'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:182:in `require'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:182:in `block in require'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:547:in `new_constants_in'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:182:in `require'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rails-2.3.18/lib/tasks/misc.rake:4:in `block in <top (required)>'
/usr/local/rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:246:in `call'
/usr/local/rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:246:in `block in execute'
/usr/local/rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:241:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:241:in `execute'
/usr/local/rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:184:in `block in invoke_with_call_chain'
/usr/local/rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'
/usr/local/rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:205:in `block in invoke_prerequisites'
/usr/local/rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:203:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:203:in `invoke_prerequisites'
/usr/local/rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:183:in `block in invoke_with_call_chain'
/usr/local/rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'
/usr/local/rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:205:in `block in invoke_prerequisites'
/usr/local/rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:203:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:203:in `invoke_prerequisites'
/usr/local/rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:183:in `block in invoke_with_call_chain'
/usr/local/rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'
/usr/local/rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:170:in `invoke'
/usr/local/rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/application.rb:143:in `invoke_task'
/usr/local/rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/application.rb:101:in `block (2 levels) in top_level'
/usr/local/rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/application.rb:101:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/application.rb:101:in `block in top_level'
/usr/local/rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/application.rb:110:in `run_with_threads'
/usr/local/rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/application.rb:95:in `top_level'
/usr/local/rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/application.rb:73:in `block in run'
/usr/local/rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling'
/usr/local/rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/application.rb:70:in `run'
/usr/local/rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in `eval'
/usr/local/rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => db:bootstrap => db:initialize => environment
(See full trace by running task with --trace)
I'm always getting that the db wasn't created... :(
Look here, they have an advice which might be useful for you.
gem update --system 1.6.2
Similar to the Gem tasteful-routes (https://github.com/icelab/tasteful-routes/blob/master/lib/tasteful_routes/mapper.rb) I wanted to be able to add some methods as routing helpers.
I have a file lib/action_dispatch/routing/mapper.rb which contains
puts "In mapper.rb"
module ActionDispatch::Routing
class Mapper
module NorthStar
def star(controller)
puts "Testing!"
end
end
include NorthStar
end
end
To autoload this I placed the following in config/application.rb
config.autoload_paths += Dir["#{config.root}/lib/**/"]
When I try to run Rails, I run into an issue.
20 ~/Dropbox/Development/RailsPlayground/site$ rails s
=> Booting WEBrick
=> Rails 3.1.0.rc3 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
In mapper.rb
Exiting
/Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/actionpack-3.1.0.rc3/lib/sprockets/railtie.rb:40:in `block (2 levels) in <class:Railtie>': undefined method `mount' for #<ActionDispatch::Routing::Mapper:0x00000100933b30> (NoMethodError)
from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/actionpack-3.1.0.rc3/lib/action_dispatch/routing/route_set.rb:257:in `instance_exec'
from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/actionpack-3.1.0.rc3/lib/action_dispatch/routing/route_set.rb:257:in `eval_block'
from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/actionpack-3.1.0.rc3/lib/action_dispatch/routing/route_set.rb:276:in `block in clear!'
from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/actionpack-3.1.0.rc3/lib/action_dispatch/routing/route_set.rb:276:in `each'
from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/actionpack-3.1.0.rc3/lib/action_dispatch/routing/route_set.rb:276:in `clear!'
from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.1.0.rc3/lib/rails/application/routes_reloader.rb:24:in `block in clear!'
from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.1.0.rc3/lib/rails/application/routes_reloader.rb:22:in `each'
from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.1.0.rc3/lib/rails/application/routes_reloader.rb:22:in `clear!'
from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.1.0.rc3/lib/rails/application/routes_reloader.rb:12:in `reload!'
from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.1.0.rc3/lib/rails/application/routes_reloader.rb:7:in `block in initialize'
from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/activesupport-3.1.0.rc3/lib/active_support/file_update_checker.rb:32:in `call'
from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/activesupport-3.1.0.rc3/lib/active_support/file_update_checker.rb:32:in `execute_if_updated'
from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.1.0.rc3/lib/rails/application/finisher.rb:63:in `block (2 levels) in <module:Finisher>'
from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.1.0.rc3/lib/rails/application/finisher.rb:64:in `call'
from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.1.0.rc3/lib/rails/application/finisher.rb:64:in `block in <module:Finisher>'
from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.1.0.rc3/lib/rails/initializable.rb:25:in `instance_exec'
from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.1.0.rc3/lib/rails/initializable.rb:25:in `run'
from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.1.0.rc3/lib/rails/initializable.rb:50:in `block in run_initializers'
from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.1.0.rc3/lib/rails/initializable.rb:49:in `each'
from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.1.0.rc3/lib/rails/initializable.rb:49:in `run_initializers'
from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.1.0.rc3/lib/rails/application.rb:96:in `initialize!'
from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.1.0.rc3/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /Users/basicxman/Dropbox/Development/RailsPlayground/site/config/environment.rb:5:in `<top (required)>'
from /Users/basicxman/Dropbox/Development/RailsPlayground/site/config.ru:4:in `require'
from /Users/basicxman/Dropbox/Development/RailsPlayground/site/config.ru:4:in `block in <main>'
from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/rack-1.3.0/lib/rack/builder.rb:51:in `instance_eval'
from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/rack-1.3.0/lib/rack/builder.rb:51:in `initialize'
from /Users/basicxman/Dropbox/Development/RailsPlayground/site/config.ru:1:in `new'
from /Users/basicxman/Dropbox/Development/RailsPlayground/site/config.ru:1:in `<main>'
from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/rack-1.3.0/lib/rack/builder.rb:40:in `eval'
from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/rack-1.3.0/lib/rack/builder.rb:40:in `parse_file'
from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/rack-1.3.0/lib/rack/server.rb:200:in `app'
from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.1.0.rc3/lib/rails/commands/server.rb:46:in `app'
from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/rack-1.3.0/lib/rack/server.rb:301:in `wrapped_app'
from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/rack-1.3.0/lib/rack/server.rb:252:in `start'
from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.1.0.rc3/lib/rails/commands/server.rb:70:in `start'
from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.1.0.rc3/lib/rails/commands.rb:54:in `block in <top (required)>'
from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.1.0.rc3/lib/rails/commands.rb:49:in `tap'
from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.1.0.rc3/lib/rails/commands.rb:49:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'