Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6784473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:59:56+00:00 2026-05-26T16:59:56+00:00

I am trying to test coffee script in my rails 3.1 project, but it

  • 0

I am trying to test coffee script in my rails 3.1 project, but it doesn’t get executed, or generated as javascript in the application.js

I have a controller Page, here is the pages.js.coffee:

test = (input) ->
  alert input

test 'hello'

but that alert never get executed at http://127.0.0.1:3000/pages,
in fact, the application.js is just empty!

here is the GemFile in case it would help:

source 'http://rubygems.org'

gem 'rails', '3.1.0'

# Bundle edge Rails instead:
# gem 'rails',     :git => 'git://github.com/rails/rails.git'

gem 'sqlite3'

gem 'devise', '1.4.8'

gem 'will_paginate', '~> 3.0.2'

#gem 'nested_form', :git => 'git://github.com/fxposter/nested_form.git'

gem "simple_form"

gem 'kaminari'

gem 'foreigner'

gem "cocoon"

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails', "  ~> 3.1.0"
  gem 'coffee-rails', "~> 3.1.0"
  gem 'uglifier'
end

gem "jquery-rails"

gem 'coffee-script'
gem 'haml'
# Use unicorn as the web server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'

group :test do
  # Pretty printed test output
  gem 'turn', :require => false
end

EDIT

I have added those gems also and installed them, but, the coffee script is not executed

gem 'therubyracer'


gem 'coffee-script-source'
gem 'json'
gem 'execjs'
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T16:59:57+00:00Added an answer on May 26, 2026 at 4:59 pm

    First: Having “coffee-rails” in your :assets group should be enough. Older versions had “coffee-script” in the :assets group.

    Second: Where are you keeping your *.js.coffee files? You need to make sure they are in an “assets” folder some place. Start with app/assets/javascripts. If they aren’t in your assets folder, they won’t make it into the asset pipeline.

    If you are doing that already, consider starting a new project and use the default configuration. It should work without any trouble. Compare the working project against the non-working project.

    If all else fails, is it possible for you to share your project with us on GitHub?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to test a method I have in my application, but I don't
I'm trying to use the vim-coffee-script plugin https://github.com/kchmck/vim-coffee-script but its not detecting a test
I'm trying to get the nodeunit module working within a coffeescript project but can't
Hi I am trying to test a RESTful Application, but keep getting the following
I'm trying to test this out on my site but it doesn't quite work
just trying to test for equality in this piece of code, but getting a
I trying to test an AccountController that uses DotNetOpenAuth but I am running into
I'm trying to use the rails plugin with hudson, but i'm getting the following
I'm trying to display the example of image_graphviz Here , but it doesn't display
Trying to test deploy a simple Rails 3.1 app in production mode, using the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.