Now I am trying to convert Rails2 application into Rails3 one.
And I used comatose as CMS in old project, but now I can not find Rails3 compatible comatose version.
Instead, I did find comatose-rubyisbeautiful gem.
So I added it in my Gemfile, and installed.
And executed the command "rails generate comatose".
It generated initializers/comatose.rb and new migration file.
Then the next step is to execute migration, by "rake db:migrate".
But it shoots me an error, like the following.
"Uninitialized constant Comatose" in config/initializers/comatose.rb
Is there anything wrong?
Please help me with this.
I am the author of the fork. I haven't touched it in years. I hope you have found an alternative since September. If not, I can help get you going with what is there, but I am not sure that I will actively maintain the gem. There has not been much interest other than the one company for whom I brought the old Comatose up to date.
Related
I just discovered the Cane gem but it doesn't work with Rails, there is a way to make it work with Rails?
Update
I'm using rails 3.2.1 and It doesn't produce any error message
I'm the author of this gem.
How do you mean "doesn't work"? It's possible you just write good code :) The default options aren't too strict. Can you please post the output of:
cane --style-glob '**/*.rb' --style-measure 1
This should error on every line in the project, to verify whether cane is "working". And also
find . app
When run from within your rails directory.
I am trying to upgrade an application from Rails 3.0.7 to 3.1.1. When I try to run a migration under 3.1.1, the migration file gets generated but without the leading timestamp. For example:
$ rails g migration add_foo_to_users foo:boolean
invoke active_record
create db/migrate/_add_foo_to_users.rb
The contents of the generated file look correct (with the new cool change method), but the migration file seems like it should be named more like db/migrate/20111012002448_add_foo_to_users.rb.
I suspect that I am missing something simple, but spent all weekend trying to figure out what it is. Search shows nothing helpful that I found. Migrations have been working all along before this, so something in the steps I took to upgrade seems to have broken it. Any suggestions of where to look would be appreciated. Thanks.
I have traced this issue down and fixed it in the GateGuru fork of also_migrate. A pull request is pending for merge back into also_migrate.
For anyone bitten by this in the interim, the pull request is at: https://github.com/winton/also_migrate/pull/10
You can also install from my fork via Bundler to fix the issue:
gem 'also_migrate', '0.3.5', :git => 'git#github.com:GateGuru/also_migrate.git', :branch => '8-fix-rails-3_1-timestamps'
Just in case anyone ends up here after hitting the same problem. After copying the entire application to another directory, and comparing to a clean install of a new Rails application, I narrowed this down to the configuration block for the also_migrate gem. When I comment out the lines for this configuration, the migration files were generated properly. Uncommenting the same lines recreates the error.
I did : git clone git#github.com:user/rails
Now how can i run/debug find bugs for ruby on rails 3.1 ?
Someone please mention the method completely.
Thanks.
Add in your Gemfile :
gem 'ruby-debug'
Then in your console type :
bundle install
Then start your application with :
rails server --debugger
Then where ever you want to set up a break point, just write the word debugger
If you want to contribute into the Rails core, first off you can use railscast, then read official doc.
Anyway it's not enough to do it. The best way is keep an eye on Rails chsngelog, test your projects and report about bugs, looking for potential bugs into Github Issues and trying to reproduce them localy.
The value contributor is the man who care about code quality, stability and primarely spend spare time to help the community, help to real business projects.
I'm a designer and brand new to programming.
I have just opened my localhost and can see "Welcome aboard". It has 3 steps to complete - all of which simple to most, are complexing to me.
config/database.yml ok it wants to know my username and password. Where do I get these and where do I post them to to get them to work? I opened my database.yml and it is
SQLite version 3.x
gem install sqlite3-ruby
I hear people talking about git and all this but confused on how to do these 3 steps -
1.
Create your databases and edit config/database.yml
Rails needs to know your login and password.
2.
Use script/generate to create your models and controllers
To see all available options, run it without parameters.
3.
Set up a default route and remove or rename this file
Routes are set up in config/routes.rb.
Is this just too over my head? I wouldn't mind hiring someone to teach get it all going for me because I really want to learn to code Ruby on Rails.
Thanks!
Note - All resolved by deleting and reinstalling. Now I understand what is actually happening.
Since you're using an SQLite database, you don't need to configure any username or password to get going with the database -- the default configuration should work out of the box and creates a new database file automatically for you.
For your other questions, the Getting Started with Rails guide over at guides.rubyonrails.org is an excellent introduction that walks you through all the steps in creating a new Rails application. Start by going through this tutorial step by step -- if you get stuck somewhere along the way you can always come back here and post follow-up questions.
If you don't have any idea what a database is you should just leave database.yml alone and use the provided defaults (use sqlite, does not require a password/login). For getting started with Rails, this should be enough. Just delete the public/index.html file.
I would really recommend you to buy a book (Rails 3) (3rd edition is for Rails 2.3) which guides you through the creation of a Rails app - with a lot of examples. The guides are an alternative, but also might be a little difficult to read with close-to-none preknowledge of programming.
I think you might find Michael Hartl's Ruby on Rails Tutorial helpful. It's available for purchase as a PDF or you can view the online version for free. It covers all the major steps of developing a Rails application, including using Git.
When I manually enter tables into the .rb file in the migrate folder nothing shows up. I have followed a few different "how to's" but I can't get the tables to show up when I preview my work. I can however get one table to show up if I create it in the parameters when generating a scaffold, but that's one table. I have Rails version 2.3.4 and version 1.2.3 installed on my lame Windows Vista. I have tried using both versions multiple times. I am also trying to follow the Ruby on Rails for Dummies book, but it seems a little outdated. Any tips on getting tables to work? Its supposed to be really simple and take "just minutes" to complete this simple app. Maybe something didn't install right? Maybe a better book?
Just want to make sure you're using all the tools available to you:
To generate a migration file:
./script/generate MigrationFileName
Take a look at the Database Migrations Guide from the official Rails Guides for the correct syntax and options for creating a migration file.
Once you've created your migration, you need to run the following:
rake db:migrate
This will populate the database with the information specified in the migration file.