Home > Syntax Error > Erb Syntax Error Unexpected $end Expecting Kend

Erb Syntax Error Unexpected $end Expecting Kend

Contents

Are there any saltwater rivers on Earth? Is [](){} a valid lambda definition? Long version: You can only do <%= some_method do %> <% end %> (that is, use <%= with a block) because of a giant flying hack in Rails. Has Tony Stark ever "gone commando" in the Iron Man suit? More about the author

Problem with StringReplace and RegularExpressions Why use a Zener in a regulator as opposed to a regular diode? Already have an account? At what times should each of the outputs be written – the result first, or the block contents first? Browse other questions tagged ruby erb or ask your own question. http://stackoverflow.com/questions/17374274/why-is-this-an-error-with-erb

Syntax Error Unexpected End Expecting Keyword_end

How do hackers find the IP address of devices? The ruby I believe seems ok. Browse other questions tagged ruby-on-rails ruby syntax-error or ask your own question. To handle blocks in this case, when you use <%=, Rails looks at the ERB code, sees whether it looks like a block by using a regular expression, and if it

Use MacBook Pro crashing Standard way for novice to prevent small round plug from rolling away while soldering wires to it Etymology of word "тройбан"? Add Answer Question Tools Follow 1 follower subscribe to rss feed Stats Asked: 2015-01-27 07:59:27 -0500 Seen: 474 times Last updated: Jan 28 '15 Related questions Puppet agent slow on "Starting For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en. _erbout Concat so it means End of file but unexpected, there should be a ')'.

You signed in with another tab or window. In it, you'll get: The week's top questions and answers Important community announcements Questions that need answers see an example newsletter By subscribing, you agree to the privacy policy and terms Not the answer you're looking for? Show Eric Sorenson added a comment - 2014/03/13 1:21 PM I think the exact message depends on your version of ruby, but Puppet does have better handling around template errors since

share|improve this answer answered May 24 '09 at 19:40 Chuck 174k19230339 add a comment| up vote 3 down vote I had the same issue. Erb New Since you say it is, then <%= is indeed what you want, so the solution must be something else. –Rory O'Kane Jun 29 '13 at 2:08 2 Excellent answer! –Ryan reply | permalink Stefan Schulte On Tue, Jul 24, 2012 at 10:47:40AM -0700, earthgecko wrote: [...] [...] if you write <% if val != "<%= hostname %>" %> The thing between Browse other questions tagged ruby-on-rails ruby or ask your own question.

Syntax Error Unexpected End Expecting T_function

reply | permalink Earthgecko Thank you Stefan Just testing and ... You signed out in another tab or window. Syntax Error Unexpected End Expecting Keyword_end Can 'it' be used to refer to a person? Ruby Syntax Error Unexpected End Expecting Keyword_end What is the most befitting place to drop 'H'itler bomb to score decisive victory in 1945?

If so, is there a reference procedure somewhere? http://dssoundware.com/syntax-error/echo-syntax-error-near-unexpected-token.php Personal Open source Business Explore Sign up Sign in Pricing Blog Support Search GitHub This repository Watch 198 Star 5,415 Fork 545 middleman/middleman Code Issues 124 Pull requests 8 Projects From that error it looks like it is expecting another <% end %> statement - any other loops/ifs/etc that aren't in the above snippet?lorcutt( 2015-01-27 11:07:02 -0500 )editHi, There are things Related 241Learning Ruby on Rails698A concise explanation of nil v. Syntax Error Unexpected End Expecting Between Or In Or Sql_token_like

Stefan Schulte at Jul 24, 2012 at 5:08 pm ⇧ On Tue, Jul 24, 2012 at 08:08:30AM -0700, earthgecko wrote:Quick erb question:Can you use a if val in an each do Hereismycode: <%ifuserotatelogs==false-%> CustomLog/var/log/httpd/<%=name%>/access.logcombined <%else-%> CustomLog"|/usr/sbin/rotatelogs<%[email protected] '-l'end%><%[email protected]'-f'end%><%=if @rotatelogsuselinkthen"-L/var/log/httpd/<%=name%>/access.log"end%> /var/log/httpd/<%=name%>/access.log.%Y-%m-%d<%=rotatelogstime%>" combined <%end-%> Theproblematicpartseemstobethepartinyellow. how :/ Ifsomeone knows and is kind enough to shed some light.Trying to figure what will work and the following do NOT work.<% hosts.each do |val| %><% if val != "<%= click site How do you say "Affirmative action"?

EarthgeckoJul 24, 2012 at 3:08 pm Quick erb question:Can you use a if val in an each do iteration? Erb Templates Perfect thanks - I did warn I'd be doing something stupid! People Assignee: Unassigned Reporter: redmine.exporter Votes: 0 Vote for this issue Watchers: 4 Start watching this issue Dates Created: 2014/01/02 11:10 PM Updated: 2014/05/28 3:16 PM Resolved: 2014/03/13 1:21 PM Agile

However what you really wanted to write was probably <% if val != @hostname %> Notice that I am addressing hostname as an instance variable.

However, for the time being problem solved, thanks for the time. Unexpected $end, expecting keyword_end0syntax error, unexpected keyword_end, expecting $end-1unexpected $end, expecting keyword_end6Syntax error “syntax error, unexpected end-of-input, expecting keyword_end (SyntaxError)”0rake routes--> rake aborted! Use open(add) (or perfectly correct, but perfectly unnecessary open("#{add}")). Ruby Erb Did Umbridge hold prejudices towards muggle-borns before the fall of the Ministry?

To unsubscribe from this group, send email to [email protected] To Earthgecko at Jul 25, 2012 at 8:39 am ⇧ Once again Stefan, thanks. Is [](){} a valid lambda definition? http://dssoundware.com/syntax-error/eclipse-syntax-error-unexpected.php Are there square integrable vector field solutions of curl(F) = F?

share|improve this answer answered Apr 9 '12 at 19:08 Brian Campbell 163k37259290 I do find it a little odd that the lexer was looking for $end instead of a Proof of infinitely many prime numbers Very simple number line with points Cartesian vs. students who have girlfriends/are married/don't come in weekends...? What, no warning when minipage overflows page?

For example (non-worky): <% link_to 'My Link', '/link.html', :class => 'main-link', data: { icon: => 'd' } do %> <% end %> ?? you don't pass the first param when you use a block (the do keyword). equations with double absolute value proof Train and bus costs in Switzerland more hot questions question feed lang-rb about us tour help blog chat data legal privacy policy work here advertising syntax error, unexpected keyword_end, expecting end-of-input (Mac)0rspec: syntax error, unexpected keyword_end, expecting end-of-input (SyntaxError)1SyntaxError unexpected keyword_ensure, expecting keyword_end0syntax error, unexpected end-of-input, expecting keyword_end (SyntaxError)-4syntax error, unexpected end-of-input, expecting keyword_end (SyntaxError) Address_book

Previous overview Next Mirrored by ma.ttias.be - Why? - Follow @oss_announce & @foss_security for more updates. Maybe erb thinks the ruby code ends after the inner %> not after the outer %>. My math students consider me a harsh grader. More gory details in the excellent blog post “Block Helpers in Rails 3”.

Would still be interested to know if you can use if val in the each do context. For instance, foo.rb: (demonstration) if true puts "hello world" end # the indent end # is a lie Line 4: syntax error, unexpected kEND [keyword_end], expecting $end Happy coding. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/byxhg0FMfnsJ. more hot questions question feed lang-rb about us tour help blog chat data legal privacy policy work here advertising info mobile contact us feedback Technology Life / Arts Culture / Recreation

http://pastebin.com/tEv64qnVwingZero( 2015-01-28 01:53:35 -0500 )editadd a comment 1 answer Sort by » oldest newest most voted 1 answered 2015-01-28 11:11:45 -0500 GregLarkin 4832 ●5 ●17 ●62 http://www.puppet.com/ Looking at your full up vote 4 down vote favorite 1 In Ruby on Rails, I sometimes get an error on the page as: compile error /Users/jian/ror/shov2/app/views/stories/index.html.erb:13: syntax error, unexpected kENSURE, expecting ')' /Users/jian/ror/shov2/app/views/stories/index.html.erb:15: syntax Can my boss open and use my computer when I'm not present? Is [](){} a valid lambda definition?

Was any city/town/place named "Washington" prior to 1790?