Ruby on Rails application could not be started - ruby-on-rails

As you can see at https://ssl.virtualweb.at/redmine/ i try to get Redmine up & running.
At the start i got this error:
undefined method `mattr_accessor' for ActiveSupport::Deprecation:Module
Could someone be so nice an give some tipps how to get it to run?
t.i.a.

Can you give us a little more information? For example - can you go and look at the logs and find the full backtrace of the error that is occurring?
Otherwise we don't know where the error is occurring. Then we can narrow it down a bit better
My best guess atm, though, is that you have the wrong version of ruby or rails or rake (or something similarly important). mattr_acessor is a fundamental method in ruby - so I'd start by reading the redmine docs to see what version of ruby you need.
Then go check if you've got that version installed... repeat with rails, required gems etc.

Related

Error message when starting Ruby on Rails server

hope I can get some help with a problem I have been having. I am getting into Ruby on Rails and used a tutorial (http://guides.rubyonrails.org/getting_started.html) to try to get started with it. It says I need Sqlite3. I followed the steps up to the point where it says to use the ruby bin\rails server command in command prompt. However, when I try to do this, I get the following error message.
When I try to install Sqlite3, I use the x86 version for Windows, as I am using Windows 8.1.
I don't know what I am doing wrong...I am not even sure if the SQlite3 files are in the right place. I use command prompt to check if I have Ruby, Rails, and Sqlite3 all installed, which I do. I also know I have the SQlite3 Ruby gem installed. I have also added SQlite3 to my PATH system variable, but that doesn't seem to work either. I always get the same above error message no matter what I do.
Anyone have any ideas as to what the problem might be? Any help would be greatly appreciated! Thanks!
I recommend setting up a Linux VM on your Windows PC and start coding on it instead of on Windows. You'll keep encountering many issues in the future if you stick with Windows. Windows & ruby on rails don't go well together. So, it's better to go with some Linux flavor or preferably Mac.
If you are going to be learning RoR with the goal of ever doing anything serious in the future, here's the best advice I can give to someone starting out: Buy a Mac. NEVER try to use Microsoft for anything but Microsoft office... you'll just end up so frustrated that you will give up. RoR is NOT the toy to try "round peg, square hole" with.
Next, being that your on a Mac, NEVER use sqlite3. You can easily use the correct database which is PostgreSQL. Why is this important?
You're starting out. Keep things very simple. Get a free Heroku account, and install the CLI (for mac). You can then do: "heroku local" to run your code locally (for building), and because it's Mac/PostgreSQL, when you go to push that code live, everything is the same (Heroku is going to be PostgreSQL) so you won't get lost for days trouble shooting the differences between where you're building the code, and where you're running the code.

Rails version clarification

I'm currently working out of the book Agile Web Development with Rails (Fourth edition) and it instructs users to use rails version 3.2.0.
I am getting an error when running "rake test" (see below)
http://pastebin.com/RZeWvFYf
After doing some looking around, it appears that this is a bug caused by my rails version.
I would like to fix this massive error dump, but it seems my only answer is to change rails version. I'd like to know if its safe to do so, or if there is a fix I didn't know about.
Thanks!
Edit- full rake about results
http://pastebin.com/yBSnjUt7
(refuses to work in code tags)

undefined method 'engines' for Rails::Engine::Railties:Class

I have been setting up ruby on rails on my mac - I'm learning (I guess we all are) - I run rails and go to the site where the app is and see the following error.
undefined method 'engines' for Rails::Engine::Railties:Class
The app was running fine until I bundle installed the dependant gems (I think I may have updated them).
How do I read this error so I know what actually is wrong.
If I have to define the method, how do I do that - what with and where?
Thanks in advance,
Dan

How to debug Rails application?

I'm new to Ruby on Rails and I'm facing quite a number of logical errors which I'm unaware of. Like a normal programmer, the thing to solve your errors is by debugging it first. May I know how to debug it? Because when i tried doing so, it already shows me an error:
"Uncaught exception: uninitialized constant Object::ApplicationController"
May I know how to solve this error and how to debug? Thanks! :)
You can either do it the quick and dirty way, in your code:
raise my_object.inspect
This will throw an exception with the information about the object.
Or use the ruby-debug gem.
I recommend you read the Debugging Rails Applications chapter in the Rails documentation.

Cucumber/Selenium newbie trying to use RoR session-data in step-definitions ... and failing

I'm spending my first few days with cucumber/selenium trying to figure out whether RBB is the thing I want to use in my latest RoR project.
My setting: Rails 2.3.5, selenium-client 1.2.17, cucumber 0.4.4 etc, quite current in my view.
Following the instructions on https://github.com/cucumber/cucumber/wiki/Setting-up-Selenium I got cucumber/selenium sorts of up and running. Simple step-definitions do work and do produce outpout that makes sense (I dont usually expect more on my first few days with anything :-) ).
My problem: I am trying to access the rails session-hash in my step-definition...and failing miserably. Refering to "session" in any "given"-clause just presents me with "undefined method `session' for nil:NilClass (NoMethodError)"
Is there any secret handshake I am missing in the docs???? Anything that has to be configured my my environment so using the session-hash is possible?
Regards
Michael
This should happen right out of the box. If you add a debugger line right to a step definition you should be able to type "session" and see something like:
{:session_id=>"f978d4220252b7e1ca51fb7319d5a365", "flash"=>{}}

Resources