Rails 3.2.3 not including javascript

28 views
Skip to first unread message

Beau

unread,
May 10, 2012, 9:26:02 AM5/10/12
to rubyonra...@googlegroups.com
Howdy,

Using rails 3.2.3 and ruby 2.0.0dev. Running rails s, doesn't seem to include the javascript. This causes Delete/destroy to never work. It just defaults to a GET and thus show.

I tested this in a barebones project

rails new testingjs
--uncomment ruby race in gemfile
bundle install
rails g scaffoled testingmodel value:integer
rake db:migrate
rails s

*voila* a rails app in which you can't delete anything, all from autogenerated code. How would I go about fixing this so I can actually use css/js? I figure theres a file somewhere thats borked.

Also I don't know much about rails "asset pipeline" but the JS/CSS files being served look like this

// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
// GO AFTER THE REQUIRES BELOW.
//
//= require jquery
//= require jquery_ujs
//= require_tree .
;

Which seems wrong to me, I don't think the client/browser should be seeing that file. 

Jeremy Walker

unread,
May 10, 2012, 9:33:40 AM5/10/12
to rubyonra...@googlegroups.com
On 10 May 2012 14:26, Beau <beau...@gmail.com> wrote:
Howdy,

Using rails 3.2.3 and ruby 2.0.0dev. Running rails s, doesn't seem to include the javascript. This causes Delete/destroy to never work. It just defaults to a GET and thus show.

I tested this in a barebones project

rails new testingjs
--uncomment ruby race in gemfile
bundle install
rails g scaffoled testingmodel value:integer
rake db:migrate
rails s

Hi, I've just followed those instructions with Rails 3.2.3 and Ruby 1.9.3p0 and everything works fine. So, it's either a ruby 2 issue, or something else in your configuration. I suspect it's the later.

Do you get the same results if you run:
bundle exec rails s
?
 

*voila* a rails app in which you can't delete anything, all from autogenerated code. How would I go about fixing this so I can actually use css/js? I figure theres a file somewhere thats borked.

Also I don't know much about rails "asset pipeline" but the JS/CSS files being served look like this

// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
// GO AFTER THE REQUIRES BELOW.
//
//= require jquery
//= require jquery_ujs
//= require_tree .
;

Which seems wrong to me, I don't think the client/browser should be seeing that file. 

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/vUMYRmIivwYJ.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Robert Walker

unread,
May 10, 2012, 10:03:41 AM5/10/12
to rubyonra...@googlegroups.com
Beau wrote in post #1060314:
> Howdy,
>
> Using rails 3.2.3 and ruby 2.0.0dev. Running rails s, doesn't seem to
> include the javascript. This causes Delete/destroy to never work. It
> just
> defaults to a GET and thus show.
>
> I tested this in a barebones project

AFAIK Rails 3.2.3 is not supported on Ruby 2.0 so I'm not surprised at
all that you're having problems. Install the latest patch of Ruby 1.9.3
and all should be well.

> Also I don't know much about rails "asset pipeline" but the JS/CSS files
> being served look like this
>
> // This is a manifest file that'll be compiled into application.js,
> which
>> // the compiled file.
>> //
>> // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED,
>> ANY BLANK LINE SHOULD
>> // GO AFTER THE REQUIRES BELOW.
>> //
>> //= require jquery
>> //= require jquery_ujs
>> //= require_tree .
>> ;
>
>
> Which seems wrong to me, I don't think the client/browser should be
> seeing
> that file.

Sounds to me like it's time for you to get to know something about the
Rails asset pipeline before incorrectly assuming something is wrong.

Have you even looked at the Rails guides:
http://guides.rubyonrails.org/asset_pipeline.html

If not that would be a really good place for you to start.

--
Posted via http://www.ruby-forum.com/.

beau trepp

unread,
May 10, 2012, 10:11:52 AM5/10/12
to rubyonra...@googlegroups.com
I'll try installing an older version of ruby then. Seems odd, I use RVM, and I generally aim for stable so wasn't expecting that to happen.

I admitted I don't know the intricacies of Rails asset pipeling. Still I know enough about javascript to identify that being the only JS file included (or script anywhere on the page), and that containing nothing to run. :S

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.

radhames brito

unread,
May 10, 2012, 10:19:13 AM5/10/12
to rubyonra...@googlegroups.com

Colin Law

unread,
May 10, 2012, 10:20:38 AM5/10/12
to rubyonra...@googlegroups.com
On 10 May 2012 15:11, beau trepp <beau...@gmail.com> wrote:
> I'll try installing an older version of ruby then. Seems odd, I use RVM, and
> I generally aim for stable so wasn't expecting that to happen.

I don't quite understand what you are saying here. Do you mean that
you believe Ruby 2 is current stable release? 1.9.3 is current
stable I think. See http://www.ruby-lang.org/en/downloads/

Colin

Mauro

unread,
May 10, 2012, 10:58:44 AM5/10/12
to rubyonra...@googlegroups.com
On 10 May 2012 16:20, Colin Law <cla...@googlemail.com> wrote:
> On 10 May 2012 15:11, beau trepp <beau...@gmail.com> wrote:
>> I'll try installing an older version of ruby then. Seems odd, I use RVM, and
>> I generally aim for stable so wasn't expecting that to happen.
>
> I don't quite understand what you are saying here.  Do you mean that
> you believe Ruby 2 is current stable release?   1.9.3 is current
> stable I think.  See http://www.ruby-lang.org/en/downloads/

yes, 1.9.3 and javascript works well.

Robert Walker

unread,
May 11, 2012, 9:01:58 AM5/11/12
to rubyonra...@googlegroups.com
Colin Law wrote in post #1060321:
> On 10 May 2012 15:11, beau trepp <beau...@gmail.com> wrote:
>> I'll try installing an older version of ruby then. Seems odd, I use RVM, and
>> I generally aim for stable so wasn't expecting that to happen.
>
> I don't quite understand what you are saying here. Do you mean that
> you believe Ruby 2 is current stable release? 1.9.3 is current
> stable I think. See http://www.ruby-lang.org/en/downloads/

Yep, That's why Ruby 2.0.0dev has that "dev' tagged to the end of it.
Think of "dev" builds as, "This is not ready for use anywhere." It's
just for developers, and contributors to the Ruby language, to try
things out and find out what breaks.

So thanks to the OP. Now we know at least one thing that breaks with the
"dev" release of Ruby. I'm sure there are many, many more things that
are broken.
Reply all
Reply to author
Forward
0 new messages